Beispiel #1
0
//---------------------------------------------------------
wxString CWKSP_PointCloud::Get_Value(CSG_Point ptWorld, double Epsilon)
{
	CSG_Shape		*pShape;

	if( (pShape = m_pPointCloud->Get_Shape(ptWorld, Epsilon)) != NULL )
	{
		if( m_Color_Field >= 0 )
		{
			switch( m_pClassify->Get_Mode() )
			{
			case CLASSIFY_LUT:
				return( m_pClassify->Get_Class_Name_byValue(pShape->asDouble(m_Color_Field)) );

			case CLASSIFY_METRIC:	default:
				return( pShape->asString(m_Color_Field) );

			case CLASSIFY_RGB:
				double	Value = pShape->asDouble(m_Color_Field);
				return( wxString::Format(wxT("R%03d G%03d B%03d"), SG_GET_R((int)Value), SG_GET_G((int)Value), SG_GET_B((int)Value)) );
			}
		}
		else
		{
			return( wxString::Format(wxT("%s: %d"), LNG("[CAP] Index"), pShape->Get_Index() + 1) );
		}
	}

	return( LNG("") );
}
Beispiel #2
0
//---------------------------------------------------------
CVIEW_Map_3D::CVIEW_Map_3D(CWKSP_Map *pMap)
	: CVIEW_Base(ID_VIEW_MAP_3D, wxString::Format(wxT("%s [%s]"), LNG("[CAP] 3D-View"), pMap->Get_Name().c_str()), ID_IMG_WND_MAP3D, CVIEW_Map_3D::_Create_Menu(), LNG("[CAP] 3D-View"))
{
	CreateStatusBar(MAP3D_STATUSBAR_COUNT);

	//-----------------------------------------------------
	m_pMap		= pMap;
	m_pImage	= new CVIEW_Map_3D_Image(this, pMap);

	//-----------------------------------------------------
	m_Play_Mode	= PLAY_MODE_NONE;

	m_Play.Add_Field(LNG("[FLD] Rotate X")			, SG_DATATYPE_Double);
	m_Play.Add_Field(LNG("[FLD] Rotate Y")			, SG_DATATYPE_Double);
	m_Play.Add_Field(LNG("[FLD] Rotate Z")			, SG_DATATYPE_Double);
	m_Play.Add_Field(LNG("[FLD] Shift X")			, SG_DATATYPE_Double);
	m_Play.Add_Field(LNG("[FLD] Shift Y")			, SG_DATATYPE_Double);
	m_Play.Add_Field(LNG("[FLD] Shift Z")			, SG_DATATYPE_Double);
	m_Play.Add_Field(LNG("[FLD] Exaggeration")		, SG_DATATYPE_Double);
	m_Play.Add_Field(LNG("[FLD] Central Projection"), SG_DATATYPE_Double);
	m_Play.Add_Field(LNG("[FLD] Steps to Next")		, SG_DATATYPE_Int);

	//-----------------------------------------------------
	_Parms_Create();

	_Parms_Dlg();
}
Beispiel #3
0
//---------------------------------------------------------
wxMenu * CWKSP_PointCloud::Get_Menu(void)
{
	wxMenu	*pMenu, *pSubMenu;

	pMenu	= new wxMenu(m_pPointCloud->Get_Name());

	CMD_Menu_Add_Item(pMenu, false, ID_CMD_WKSP_ITEM_CLOSE);
	CMD_Menu_Add_Item(pMenu, false, ID_CMD_POINTCLOUD_SHOW);
	CMD_Menu_Add_Item(pMenu, false, ID_CMD_POINTCLOUD_SAVE);
	CMD_Menu_Add_Item(pMenu, false, ID_CMD_POINTCLOUD_SAVEAS);
	CMD_Menu_Add_Item(pMenu, false, ID_CMD_WKSP_ITEM_SETTINGS_COPY);

	pMenu->AppendSeparator();

	pSubMenu	= new wxMenu(LNG("[MNU] Classificaton"));
	CMD_Menu_Add_Item(pSubMenu	, false, ID_CMD_POINTCLOUD_RANGE_MINMAX);
	CMD_Menu_Add_Item(pSubMenu	, false, ID_CMD_POINTCLOUD_RANGE_STDDEV150);
	CMD_Menu_Add_Item(pSubMenu	, false, ID_CMD_POINTCLOUD_RANGE_STDDEV200);

	pMenu->Append(ID_CMD_WKSP_FIRST, LNG("[MNU] Classification"), pSubMenu);


//	wxMenu	*pTable	= new wxMenu(LNG("[MNU] Table"));
//	CMD_Menu_Add_Item(pTable,  true, ID_CMD_TABLES_SHOW);
//	CMD_Menu_Add_Item(pTable,  true, ID_CMD_TABLES_DIAGRAM);
//	CMD_Menu_Add_Item(pTable, false, ID_CMD_TABLES_SCATTERPLOT);
//	pMenu->Append(ID_CMD_WKSP_FIRST, LNG("[MNU] Attributes"), pTable);

	return( pMenu );
}
JNIEXPORT jlong JNICALL
Java_com_freiheit_gnupg_GnuPGData_gpgmeDataNewFromMem(JNIEnv * env,
						      jobject self,
						      jbyteArray plain)
{
    gpgme_error_t err;

    jbyte *plain_ptr = (*env)->GetByteArrayElements(env, plain, NULL);	//GETMEM(0)
    if (plain_ptr == NULL) {
        fprintf(stderr, "could not allocate memory.\n");
	return 0;
    }

    gpgme_data_t data;
    jlong len = (*env)->GetArrayLength(env, plain);

    //make private copy of data
    err = gpgme_data_new_from_mem(&data, (const char *) plain_ptr,
				  (size_t) len, 1);
    if (UTILS_onErrorThrowException(env, err)) {
	return LNG(NULL);
    }

    (*env)->ReleaseByteArrayElements(env, plain, plain_ptr, 0);	//RELMEM(0)
    jlong result = LNG(data);
    return result;
}
Beispiel #5
0
//---------------------------------------------------------
wxMenu * CVIEW_Map_3D::_Create_Menu(void)
{
	wxMenu	*pMenu	= new wxMenu(), *pMenu_Sub;

	CMD_Menu_Add_Item(pMenu    , false, ID_CMD_MAP3D_PARAMETERS);

	pMenu_Sub	= new wxMenu();
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_ROTATE_X_LESS);
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_ROTATE_X_MORE);
//	pMenu_Sub->AppendSeparator();
//	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_ROTATE_Y_LESS);
//	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_ROTATE_Y_MORE);
	pMenu_Sub->AppendSeparator();
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_ROTATE_Z_LESS);
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_ROTATE_Z_MORE);
	pMenu->Append(ID_CMD_MAP3D_FIRST, LNG("[MNU] Rotation"), pMenu_Sub);

	pMenu_Sub	= new wxMenu();
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_SHIFT_X_LESS);
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_SHIFT_X_MORE);
	pMenu_Sub->AppendSeparator();
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_SHIFT_Y_LESS);
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_SHIFT_Y_MORE);
	pMenu_Sub->AppendSeparator();
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_SHIFT_Z_LESS);
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_SHIFT_Z_MORE);
	pMenu->Append(ID_CMD_MAP3D_FIRST, LNG("[MNU] Shift"), pMenu_Sub);

	CMD_Menu_Add_Item(pMenu    , false, ID_CMD_MAP3D_EXAGGERATE_LESS);
	CMD_Menu_Add_Item(pMenu    , false, ID_CMD_MAP3D_EXAGGERATE_MORE);
	pMenu->AppendSeparator();
	CMD_Menu_Add_Item(pMenu    ,  true, ID_CMD_MAP3D_CENTRAL);
	CMD_Menu_Add_Item(pMenu    , false, ID_CMD_MAP3D_CENTRAL_LESS);
	CMD_Menu_Add_Item(pMenu    , false, ID_CMD_MAP3D_CENTRAL_MORE);
	pMenu->AppendSeparator();
	CMD_Menu_Add_Item(pMenu    ,  true, ID_CMD_MAP3D_INTERPOLATED);
	pMenu->AppendSeparator();
	CMD_Menu_Add_Item(pMenu    ,  true, ID_CMD_MAP3D_STEREO);
	CMD_Menu_Add_Item(pMenu    , false, ID_CMD_MAP3D_STEREO_LESS);
	CMD_Menu_Add_Item(pMenu    , false, ID_CMD_MAP3D_STEREO_MORE);
	pMenu->AppendSeparator();
	CMD_Menu_Add_Item(pMenu    , false, ID_CMD_MAP3D_SAVE);

	pMenu_Sub	= new wxMenu();
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_SEQ_POS_ADD);
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_SEQ_POS_DEL);
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_SEQ_POS_DEL_ALL);
	CMD_Menu_Add_Item(pMenu_Sub, false, ID_CMD_MAP3D_SEQ_POS_EDIT);
	pMenu_Sub->AppendSeparator();
	CMD_Menu_Add_Item(pMenu_Sub,  true, ID_CMD_MAP3D_SEQ_PLAY);
	CMD_Menu_Add_Item(pMenu_Sub,  true, ID_CMD_MAP3D_SEQ_PLAY_LOOP);
	CMD_Menu_Add_Item(pMenu_Sub,  true, ID_CMD_MAP3D_SEQ_SAVE);
	pMenu->Append(ID_CMD_MAP3D_FIRST, LNG("[MNU] Sequencer"), pMenu_Sub);

	return( pMenu );
}
Beispiel #6
0
//---------------------------------------------------------
const wxChar * CMD_Get_Help(int Cmd_ID)
{
	switch( Cmd_ID )
	{
	case ID_CMD_FRAME_QUIT:				return( LNG("[CMD] Exit SAGA") );
	case ID_CMD_FRAME_ABOUT:			return( LNG("[CMD] About SAGA") );
	}

	return( CMD_Get_Name(Cmd_ID) );
}
Beispiel #7
0
//---------------------------------------------------------
CWKSP_Grid_System::CWKSP_Grid_System(const CSG_Grid_System &System)
{
	m_System	= System;

	m_Parameters.Add_String(
		NULL	, "NAME"	, LNG("Name"),
		LNG("Descriptive name for the grid system"),
		m_System.Get_Name()
	);
}
JNIEXPORT jlong JNICALL
Java_com_freiheit_gnupg_GnuPGData_gpgmeDataNew(JNIEnv * env, jobject self)
{
    gpgme_data_t data;
    gpgme_error_t err = gpgme_data_new(&data);
    if (UTILS_onErrorThrowException(env, err)) {
	return LNG(NULL);
    }

    return LNG(data);
}
Beispiel #9
0
//---------------------------------------------------------
CSG_Grid & CSG_Grid::_Operation_Arithmetic(double Value, TSG_Grid_Operation Operation)
{
	//-----------------------------------------------------
	switch( Operation )
	{
	case GRID_OPERATION_Addition:
		Get_History().Add_Child(SG_T("GRID_OPERATION"), Value)->Add_Property(SG_T("NAME"), LNG("Addition"));
		break;

	case GRID_OPERATION_Subtraction:
		Get_History().Add_Child(SG_T("GRID_OPERATION"), Value)->Add_Property(SG_T("NAME"), LNG("Subtraction"));
		Value	= -Value;
		break;

	case GRID_OPERATION_Multiplication:
		Get_History().Add_Child(SG_T("GRID_OPERATION"), Value)->Add_Property(SG_T("NAME"), LNG("Multiplication"));
		break;

	case GRID_OPERATION_Division:
		if( Value == 0.0 )
			return( *this );

		Get_History().Add_Child(SG_T("GRID_OPERATION"), Value)->Add_Property(SG_T("NAME"), LNG("Division"));
		Value	= 1.0 / Value;
		break;
	}

	//-----------------------------------------------------
	for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
	{
		for(int x=0; x<Get_NX(); x++)
		{
			if( !is_NoData(x, y) )
			{
				switch( Operation )
				{
				case GRID_OPERATION_Addition:
				case GRID_OPERATION_Subtraction:
					Add_Value(x, y, Value);
					break;

				case GRID_OPERATION_Multiplication:
				case GRID_OPERATION_Division:
					Mul_Value(x, y, Value);
					break;
				}
			}
		}
	}

	SG_UI_Process_Set_Ready();

	return( *this );
}
//---------------------------------------------------------
wxString CWKSP_Module_Manager::Get_Description(void)
{
    wxString	s;

    s.Printf(wxT("<b>%s: %d</b><br><br>%s %d<br>"),
             LNG("[CAP] Module Libraries")	, Get_Count(),
             LNG("[CAP] Modules")			, Get_Items_Count()
            );

    return( s );
}
Beispiel #11
0
//---------------------------------------------------------
// int varying;  Does the result of the function vary
// even when the parameters stay the same?
// varying = 1 for e.g. random - number generators.
// Result: 0 is rendered if there is an error
// 1 is rendered otherwise
//
int CSG_Formula::Add_Function(SG_Char *name, TSG_PFNC_Formula_1 f, int n_pars, int varying)
{
	TSG_Formula_Item *where;
	
	if( n_pars < 0 || n_pars > 3 )
	{
		_Set_Error(LNG("invalid number of parameters"));

		return( 0 );
	}

	for(where=gSG_Functions; where->f != NULL && SG_STR_CMP(name, where->name); where++)
	{
		;
	}

	if( where->f != NULL )
	{
		where->f		= f;
		where->varying	= varying;
		where->n_pars	= n_pars;   /*old function is superseded */

		_Set_Error();

		return( 1 );
	}
	else if( (where - gSG_Functions) >= MAX_CTABLE - 1 )
	{
		_Set_Error(LNG("function table full"));

		return 0;
	}
	else 
	{
		where->name	=(SG_Char *)calloc(SG_STR_LEN(name) + 1, sizeof(SG_Char));

		if( where->name == NULL )
		{
			_Set_Error(LNG("no memory"));

			return( 0 );
		}

		SG_STR_CPY(where->name, name);
		where->f		= f;
		where->varying	= varying;
		where->n_pars	= n_pars;

		_Set_Error();

		return( 1 );
	}
}
Beispiel #12
0
//---------------------------------------------------------
CVIEW_Layout::CVIEW_Layout(CVIEW_Layout_Info *pInfo)
	: CVIEW_Base(ID_VIEW_LAYOUT, LNG("[CAP] Map-Layout"), ID_IMG_WND_LAYOUT, CVIEW_Layout::_Create_Menu(), LNG("[CAP] Map-Layout"))
{
	SYS_Set_Color_BG(this, wxSYS_COLOUR_3DFACE);

	m_pInfo		= pInfo;

	m_pRuler_X	= new CVIEW_Ruler(this, RULER_HORIZONTAL|RULER_EDGE_SUNKEN);
	m_pRuler_Y	= new CVIEW_Ruler(this, RULER_VERTICAL  |RULER_EDGE_SUNKEN);

	m_pControl	= new CVIEW_Layout_Control(this);

	SetTitle(wxString::Format(wxT("%s - %s"), pInfo->Get_Map()->Get_Name().c_str(), LNG("[CAP] Map-Layout")));
}
Beispiel #13
0
//---------------------------------------------------------
const wxChar * DLG_Get_Text(int ID_DLG)
{
    switch( ID_DLG )
    {
    case ID_DLG_ABOUT:
        return( LNG("[TXT] SAGA\nSystem for Automated Geoscientific Analyses\nVersion 2.0") );
    case ID_DLG_CLOSE:
        return( LNG("[TXT] Do you want to exit SAGA?") );
    case ID_DLG_DELETE:
        return( LNG("[TXT] Do you want to delete the selection?") );
    }

    return( LNG("[TXT] This is not a text!") );
}
Beispiel #14
0
//---------------------------------------------------------
const wxChar * DLG_Get_Caption(int ID_DLG)
{
    switch( ID_DLG )
    {
    case ID_DLG_CLOSE:
        return( LNG("[CAP] Exit") );
    case ID_DLG_ABOUT:
        return( LNG("[CAP] About SAGA") );
    case ID_DLG_DELETE:
        return( LNG("[CAP] Delete") );
    }

    return( LNG("[CAP] This Is Not A Caption!") );
}
Beispiel #15
0
//---------------------------------------------------------
bool CSG_Grid::Assign(double Value)
{
	if( is_Valid() )
	{
		if( Value == 0.0 && m_Memory_Type == GRID_MEMORY_Normal )
		{
			for(int n=0, m=_Get_nLineBytes(); n<Get_NY(); n++)
			{
				memset(m_Values[n], 0, m);
			}
		}
		else
		{
			for(int n=0; n<Get_NCells(); n++)
			{
				Set_Value(n, Value);
			}
		}

		//-------------------------------------------------
		Get_History().Destroy();
		Get_History().Add_Child(SG_T("GRID_OPERATION"), Value)->Add_Property(SG_T("NAME"), LNG("Assign"));

		//-------------------------------------------------
		m_zStats.Invalidate();

		Set_Update_Flag(false);

		return( true );
	}

	return( false );
}
JNIEXPORT jlong JNICALL
Java_com_freiheit_gnupg_GnuPGSignature_gpgmeGetNextSignature(JNIEnv* env,
        jobject self,
        jlong sig)
{
    return LNG((KEYSIG(sig))->next);
}
Beispiel #17
0
//---------------------------------------------------------
void CVIEW_Map_3D::_Play_Pos_Edit(void)
{
	if( m_Play_Mode == PLAY_MODE_NONE )
	{
		DLG_Table(LNG("[CAP] 3D-View: Player Sequence"), &m_Play);
	}
}
Beispiel #18
0
//---------------------------------------------------------
void CSG_Grid::Invert(void)
{
	int		x, y;
	double	zMin, zMax;

	if( is_Valid() && Get_ZRange() > 0.0 )
	{
		zMin	= Get_ZMin();
		zMax	= Get_ZMax();

		for(y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
		{
			for(x=0; x<Get_NX(); x++)
			{
				if( !is_NoData(x, y) )
				{
					Set_Value(x, y, zMax - (asDouble(x, y) - zMin));
				}
			}
		}

		SG_UI_Process_Set_Ready();

		Get_History().Add_Child(SG_T("GRID_OPERATION"), LNG("Inversion"));
	}
}
Beispiel #19
0
//---------------------------------------------------------
wxToolBarBase * CVIEW_Map_3D::_Create_ToolBar(void)
{
	wxToolBarBase	*pToolBar	= CMD_ToolBar_Create(ID_TB_VIEW_MAP_3D);

	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_PARAMETERS);
	CMD_ToolBar_Add_Item(pToolBar,  true, ID_CMD_MAP3D_INTERPOLATED);
	CMD_ToolBar_Add_Item(pToolBar,  true, ID_CMD_MAP3D_STEREO);
	CMD_ToolBar_Add_Separator(pToolBar);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_ROTATE_X_LESS);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_ROTATE_X_MORE);
//	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_ROTATE_Y_LESS);
//	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_ROTATE_Y_MORE);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_ROTATE_Z_LESS);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_ROTATE_Z_MORE);
	CMD_ToolBar_Add_Separator(pToolBar);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_SHIFT_X_LESS);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_SHIFT_X_MORE);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_SHIFT_Y_LESS);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_SHIFT_Y_MORE);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_SHIFT_Z_LESS);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_SHIFT_Z_MORE);
	CMD_ToolBar_Add_Separator(pToolBar);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_EXAGGERATE_LESS);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_EXAGGERATE_MORE);
	CMD_ToolBar_Add_Separator(pToolBar);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_CENTRAL_LESS);
	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MAP3D_CENTRAL_MORE);

	CMD_ToolBar_Add(pToolBar, LNG("[CAP] 3D-View"));

	return( pToolBar );
}
Beispiel #20
0
//---------------------------------------------------------
// If the function exists, it is deleted and a non-negative
// value is returned. Otherwise, -1 is returned.
// Original library functions may not be deleted.
//
int CSG_Formula::Del_Function(SG_Char *name)
{
	int		place	 = _Get_Function(name);

	if( place == -1 )
	{
		return( -1 );	// there is an error message already
	}

	if( place < STD_FNC_NUM )
	{
		_Set_Error(LNG("original functions may not be deleted"));

		return( -1 );
	}

	free(gSG_Functions[place].name);

	TSG_Formula_Item	*pFunction;

	for(pFunction=&gSG_Functions[place]; pFunction->f!=NULL; pFunction++)
	{
		pFunction->name		= (pFunction + 1)->name;
		pFunction->f		= (pFunction + 1)->f;
		pFunction->n_pars	= (pFunction + 1)->n_pars;
	}

	_Set_Error();

	return( pFunction - gSG_Functions );
}
Beispiel #21
0
//---------------------------------------------------------
CSG_String CSG_Module_Library::Get_Summary(bool bHTML)
{
	CSG_String	s;

	if( bHTML )
	{
		s.Printf(
			SG_T("%s: <b>%s</b><br>%s: <i>%s</i><br>%s: <i>%s</i><br>%s: <i>%s</i><hr>%s"),
			LNG("[CAP] Module Library")	, Get_Info(MLB_INFO_Name),
			LNG("[CAP] Author")			, Get_Info(MLB_INFO_Author),
			LNG("[CAP] Version")		, Get_Info(MLB_INFO_Version),
			LNG("[CAP] File")			, Get_File_Name().c_str(),
			Get_Info(MLB_INFO_Description)
		);

		s.Append(CSG_String::Format(SG_T("<hr><b>%s:<ul>"), LNG("[CAP] Modules")));

		for(int i=0; i<Get_Count(); i++)
		{
			s.Append(CSG_String::Format(SG_T("<li>%s</li>"), Get_Module(i)->Get_Name()));
		}

		s.Append(SG_T("</ul>"));

		s.Replace(SG_T("\n"), SG_T("<br>"));
	}
	else
	{
		s.Printf(
			SG_T("%s: %s\n%s: %s\n%s: %s\n%s: %s\n\n%s"),
			LNG("[CAP] Module Library")	, Get_Info(MLB_INFO_Name),
			LNG("[CAP] Author")			, Get_Info(MLB_INFO_Author),
			LNG("[CAP] Version")		, Get_Info(MLB_INFO_Version),
			LNG("[CAP] File")			, Get_File_Name().c_str(),
			Get_Info(MLB_INFO_Description)
		);

		s.Append(CSG_String::Format(SG_T("\n\n%s:\n"), LNG("[CAP] Modules")));

		for(int i=0; i<Get_Count(); i++)
		{
			s.Append(CSG_String::Format(SG_T("- %s\n"), Get_Module(i)->Get_Name()));
		}
	}

	return( s );
}
Beispiel #22
0
//---------------------------------------------------------
int			DLG_Maps_Add(void)
{
    bool		bOk;
    int			i;
    wxString	*Maps;

    if( g_pMaps )
    {
        if( g_pMaps->Get_Count() <= 0 )
        {
            return( 0 );
        }
        else
        {
            Maps	= new wxString[g_pMaps->Get_Count() + 1];

            for(i=0; i<g_pMaps->Get_Count(); i++)
            {
                Maps[i]	= g_pMaps->Get_Map(i)->Get_Name();
            }

            Maps[i]	= LNG("[VAL] New");

            wxSingleChoiceDialog	dlg(
                MDI_Get_Top_Window(),
                LNG("[CAP] Map Selection"),
                LNG("[DLG] Add layer to selected map"),
                g_pMaps->Get_Count() + 1,
                Maps
            );

            dlg.SetSelection(g_pMaps->Get_Count());

            bOk		= dlg.ShowModal() == wxID_OK;

            delete[](Maps);

            if( bOk )
            {
                return( dlg.GetSelection() );
            }
        }
    }

    return( -1 );
}
Beispiel #23
0
//---------------------------------------------------------
bool CSG_Grid::_Load(const CSG_String &File_Name, TSG_Data_Type Type, TSG_Grid_Memory_Type Memory_Type)
{
	bool	bResult;

	//-----------------------------------------------------
	Destroy();

	m_Type	= Type;

	//-----------------------------------------------------
	SG_UI_Msg_Add(CSG_String::Format(SG_T("%s: %s..."), LNG("[MSG] Load grid"), File_Name.c_str()), true);

	if( SG_File_Cmp_Extension(File_Name, SG_T("grd")) )
	{
		bResult	= _Load_Surfer(File_Name, Memory_Type);
	}
	else
	{
		bResult	= _Load_Native(File_Name, Memory_Type);
	}

	//-----------------------------------------------------
	if( bResult )
	{
		Set_Update_Flag();

		Set_File_Name(File_Name);

		Load_MetaData(File_Name);

		m_bCreated	= true;

		SG_UI_Msg_Add(LNG("[MSG] okay"), false, SG_UI_MSG_STYLE_SUCCESS);
	}
	else
	{
		Destroy();

		SG_UI_Msg_Add(LNG("[MSG] failed"), false, SG_UI_MSG_STYLE_FAILURE);

		SG_UI_Msg_Add_Error(LNG("[ERR] Grid file could not be opened."));
	}

	//-----------------------------------------------------
	return( bResult );
}
Beispiel #24
0
//---------------------------------------------------------
wxString CWKSP_TIN_Manager::Get_Description(void)
{
	wxString	s;

	s.Printf(wxT("<b>%s</b>:%d<br>"), LNG("[CAP] TIN"), Get_Count());

	return( s );
}
Beispiel #25
0
//---------------------------------------------------------
wxString		Get_TableInfo_asHTML(CSG_Table *pTable)
{
	wxString	s;

	if( pTable && pTable->is_Valid() )
	{
		s.Append(wxString::Format(wxT("<table border=\"1\"><tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th>"),
			LNG("[CAP] Field"),
			LNG("[CAP] Name"),
			LNG("[CAP] Type"),
			LNG("[CAP] Minimum"),
			LNG("[CAP] Maximum"),
			LNG("[CAP] Mean"),
			LNG("[CAP] Standard Deviation")
		));

		for(int i=0; i<pTable->Get_Field_Count(); i++)
		{
			s.Append(wxString::Format(wxT("<tr><td>%d</td><td>%s</td><td>%s</td><td>%f</td><td>%f</td><td>%f</td><td>%f</td></tr>"),
				i + 1,
				pTable->Get_Field_Name(i),
				SG_Data_Type_Get_Name(pTable->Get_Field_Type(i)),
				pTable->Get_Minimum(i),
				pTable->Get_Maximum(i),
				pTable->Get_Mean(i),
				pTable->Get_StdDev(i)
			));
		}

		s.Append(wxT("</table>"));
	}

	return( s );
}
Beispiel #26
0
//---------------------------------------------------------
wxString CWKSP_Grid_System::Get_Description(void)
{
	wxString	s;

	s.Printf(wxT("<b>%s</b><table border=\"0\">"), LNG("[CAP] Grid System"));

	s.Append(wxString::Format(wxT("<tr><td>%s</td><td>%s</td></tr>"),
		LNG("[CAP] Name")					, Get_Name().c_str()
	));

	s.Append(wxString::Format(wxT("<tr><td>%s</td><td>%d</td></tr>"),
		LNG("[CAP] Number Of Grids")		, Get_Count()
	));

	s.Append(wxString::Format(wxT("<tr><td>%s</td><td>%d (x) * %d (y) = %ld</td></tr>"),
		LNG("[CAP] Number Of Cells")		, m_System.Get_NX(), m_System.Get_NY(), m_System.Get_NCells()
	));

	s.Append(wxString::Format(wxT("<tr><td>%s</td><td>%f</td></tr>"),
		LNG("[CAP] Cell Size")				, m_System.Get_Cellsize()
	));

	s.Append(wxString::Format(wxT("<tr><td>%s</td><td>[%f] - [%f] = [%f]</td></tr>"),
		LNG("[CAP] West-East")				, m_System.Get_XMin(), m_System.Get_XMax(), m_System.Get_XRange()
	));

	s.Append(wxString::Format(wxT("<tr><td>%s</td><td>[%f] - [%f] = [%f]</td></tr>"),
		LNG("[CAP] South-North")			, m_System.Get_YMin(), m_System.Get_YMax(), m_System.Get_YRange()
	));

	s.Append(wxT("</table>"));

	//-----------------------------------------------------
	return( s );
}
Beispiel #27
0
//---------------------------------------------------------
bool		DLG_Image_Save(wxString &File_Path, int &Type, const wxChar *def_Dir, const wxChar *def_File)
{
    static	int	Filter_Index	= 3;

    wxFileDialog	dlg(
        MDI_Get_Top_Window(), LNG("[CAP] Save As Image"), def_Dir, def_File, wxString::Format(
            wxT("%s (*.bmp)|*.bmp|")
            wxT("%s (*.jpg)|*.jpg;*.jif;*.jpeg|")
            wxT("%s (*.tif)|*.tif;*.tiff|")
            wxT("%s (*.png)|*.png|")
            wxT("%s (*.gif)|*.gif|")
            wxT("%s (*.pcx)|*.pcx"),
            LNG("Windows or OS/2 Bitmap"),
            LNG("JPEG - JFIF Compliant"),
            LNG("Tagged Image File Format"),
            LNG("Portable Network Graphics"),
            LNG("CompuServe Graphics Interchange"),
            LNG("Zsoft Paintbrush")
        ), wxSAVE|wxOVERWRITE_PROMPT
    );

    dlg.SetFilterIndex(Filter_Index);

    if( dlg.ShowModal() == wxID_OK )
    {
        File_Path		= dlg.GetPath();
        Filter_Index	= dlg.GetFilterIndex();

        switch( Filter_Index )
        {
        default:
        case 0:
            Type	= wxBITMAP_TYPE_BMP;
            break;
        case 1:
            Type	= wxBITMAP_TYPE_JPEG;
            break;
        case 2:
            Type	= wxBITMAP_TYPE_TIF;
            break;
        case 3:
            Type	= wxBITMAP_TYPE_PNG;
            break;
        case 4:
            Type	= wxBITMAP_TYPE_GIF;
            break;
        case 5:
            Type	= wxBITMAP_TYPE_PCX;
            break;
        case 6:
            Type	= wxBITMAP_TYPE_PNM;
            break;
        }

        return( true );
    }

    return( false );
}
Beispiel #28
0
//---------------------------------------------------------
CWKSP_PointCloud::CWKSP_PointCloud(CSG_PointCloud *pPointCloud)
	: CWKSP_Layer(pPointCloud)
{
	m_pPointCloud	= pPointCloud;

	m_Edit_Attributes.Destroy();
	m_Edit_Attributes.Add_Field(LNG("[CAP] Name") , SG_DATATYPE_String);
	m_Edit_Attributes.Add_Field(LNG("[CAP] Value"), SG_DATATYPE_String);

	Create_Parameters();

	//-----------------------------------------------------
	m_Parameters("COLORS_TYPE")		->Set_Value(CLASSIFY_METRIC);
	m_Parameters("COLORS_ATTRIB")	->Set_Value(2);

	On_Parameter_Changed(&m_Parameters, m_Parameters("COLORS_ATTRIB"));

	Parameters_Changed();
}
//---------------------------------------------------------
bool CWKSP_Module_Manager::Open(const wxChar *File_Name)
{
    CWKSP_Module_Library	*pLibrary;

    //-----------------------------------------------------
    if( SG_File_Cmp_Extension(File_Name, wxT("mlb"))
            ||	SG_File_Cmp_Extension(File_Name, wxT("dll"))
            ||	SG_File_Cmp_Extension(File_Name, wxT("so" )) )
    {
        MSG_General_Add(wxString::Format(wxT("%s: %s..."), LNG("[MSG] Load library"), File_Name), true, true);

        //-------------------------------------------------
        for(int i=0; i<Get_Count(); i++)
        {
            if( SG_STR_CMP(File_Name, Get_Library(i)->Get_File_Name()) == 0 )
            {
                MSG_Error_Add(wxString::Format(wxT("%s\n%s"), File_Name, LNG("[ERR] Library has already been loaded")), true);
                MSG_General_Add(LNG("[MSG] has already been loaded"), false);

                return( false );
            }
        }

        //-------------------------------------------------
        pLibrary	= new CWKSP_Module_Library(File_Name);

        if( pLibrary->is_Valid() )
        {
            Add_Item(pLibrary);

            MSG_General_Add(LNG("[MSG] okay"), false, false, SG_UI_MSG_STYLE_SUCCESS);

            return( true );
        }

        delete(pLibrary);

        MSG_General_Add(LNG("[MSG] failed"), false, false, SG_UI_MSG_STYLE_FAILURE);
    }

    return( false );
}
Beispiel #30
0
//---------------------------------------------------------
bool		SG_UI_Process_Set_Ready(void)
{
	if( gSG_UI_Callback )
	{
		SG_UI_Process_Set_Text(LNG("ready"));

		return( gSG_UI_Callback(CALLBACK_PROCESS_SET_READY, 0, 0) != 0 );
	}

	return( true );
}