Exemple #1
0
//---------------------------------------------------------
CPoints_View_Dialog::CPoints_View_Dialog(CSG_PointCloud *pPoints)
	: CSGDI_Dialog(_TL("Point Cloud Viewer"), SGDI_DLG_STYLE_START_MAXIMISED)
{
	SetWindowStyle(wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE);

	//-----------------------------------------------------
	m_Settings.Create(NULL, _TL("Point Cloud Viewer Settings"), _TL(""));

	m_pView		= new CPoints_View_Control	(this, pPoints, m_Settings);
	m_pExtent	= new CPoints_View_Extent	(this, pPoints, m_Settings, wxSize(200, 200));

	//-----------------------------------------------------
	wxArrayString	Attributes;

	for(int i=0; i<pPoints->Get_Field_Count(); i++)
	{
		Attributes.Add(pPoints->Get_Field_Name(i));
	}

	//-----------------------------------------------------
	Add_Button(_TL("Close"), wxID_OK);

	m_pBtn_Prop			= Add_Button	(_TL("Advanced Settings")	, wxID_ANY);

	Add_Spacer();
	m_pField_Z			= Add_Choice	(_TL("Z Attribute")			, Attributes, m_pView->m_zField);
	m_pField_Color		= Add_Choice	(_TL("Color Attribute")		, Attributes, m_pView->m_cField);

	Add_Spacer();
	m_pCheck_Central	= Add_CheckBox	(_TL("Central Projection")	, m_pView->m_bCentral);
	m_pCheck_Stereo		= Add_CheckBox	(_TL("Anaglyph")			, m_pView->m_bStereo);
	m_pCheck_Scale		= Add_CheckBox	(_TL("Scale Point Size")	, m_pView->m_bScale);

	Add_Spacer();
	m_pSlide_xRotate	= Add_Slider	(_TL("X-Rotation")			, m_pView->m_xRotate * M_RAD_TO_DEG, -180.0, 180.0);
	m_pSlide_yRotate	= Add_Slider	(_TL("Y-Rotation")			, m_pView->m_yRotate * M_RAD_TO_DEG, -180.0, 180.0);
	m_pSlide_zRotate	= Add_Slider	(_TL("Z-Rotation")			, m_pView->m_zRotate * M_RAD_TO_DEG, -180.0, 180.0);

	m_pSlide_Central	= Add_Slider	(_TL("Eye Distance")		, m_pView->m_dCentral, 1.0, 2000.0);

	m_pSlide_Detail		= Add_Slider	(_TL("Level of Detail")		, m_pView->m_Detail, 0.0, 1.0);

//	Add_Spacer();
//	m_pParameters		= Add_TextCtrl	(_TL("Function Parameters"), wxTE_MULTILINE|wxTE_READONLY);

	Add_Spacer();
	Add_CustomCtrl(_TL("Extent"), m_pExtent);

	Add_Output(m_pView);
}
//---------------------------------------------------------
CVariogram_Dialog::CVariogram_Dialog(void)
	: CSGDI_Dialog(_TL("Variogram"))
{
	m_pPoints		= NULL;
	m_nPoints		= 0;
	m_Attribute		= 0;
	m_pVariogram	= NULL;
	m_pModel		= NULL;
	m_Distance		= -1;

	//-----------------------------------------------------
	wxArrayString	Formulas;

	Formulas.Empty();
	Formulas.Add(SG_T("a + b * x"));												// 1st order polynom (linear)
	Formulas.Add(SG_T("a + b * x + c * x^2"));										// 2nd order polynom (quadric)
	Formulas.Add(SG_T("a + b * x + c * x^2 + d * x^3"));							// 3rd order polynom (cubic)
	Formulas.Add(SG_T("a + b * x + c * x^2 + d * x^3 + e * x^4"));					// 4th order polynom
	Formulas.Add(SG_T("a + b * sqrt(x)"));											// square root
	Formulas.Add(SG_T("a + b * ln(x)"));											// logarithmic
	Formulas.Add(SG_T("a + b * x^c"));												// exponential
	Formulas.Add(SG_T("a + b * (1 - exp(-(x / b)^2))"));							// gaussian
	Formulas.Add(SG_T("a + b * ifelse(x > c, 1, 1.5 * x / c - 0.5 * x^3 / c^3)"));	// spherical

	//-----------------------------------------------------
	Add_Button(_TL("Ok")		, wxID_OK);
	Add_Button(_TL("Cancel")	, wxID_CANCEL);

	Add_Spacer();
	m_pSettings		= Add_Button	(_TL("Settings"), wxID_ANY);

	Add_Spacer();
	m_pPairs		= Add_CheckBox	(_TL("Number of Pairs"), false);

	Add_Spacer();
	m_pFormulas		= Add_Choice	(_TL("Predefined Functions"), Formulas, 0);

	Add_Spacer();
	m_pDistance		= Add_Slider	(_TL("Function Fitting Range"), 1, 0, 1);

	Add_Spacer();
	m_pParameters	= Add_TextCtrl	(_TL("Function Parameters"), wxTE_MULTILINE|wxTE_READONLY);

	//-----------------------------------------------------
	Add_Output(
		m_pDiagram = new CVariogram_Diagram(this),
		m_pFormula = new wxTextCtrl(this, wxID_ANY, SG_T("a + b * x"), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER),
		1, 0
	);

	//-----------------------------------------------------
	m_Settings.Set_Name(_TL("Variogram Settings"));

	m_Settings.Add_Value (NULL, "SKIP"   , _TL("Skip"            ), _TL(""), PARAMETER_TYPE_Int   , 1,   1, true);
	m_Settings.Add_Value (NULL, "LAGDIST", _TL("Lag Distance"    ), _TL(""), PARAMETER_TYPE_Double, 1, 0.0, true);
	m_Settings.Add_Value (NULL, "MAXDIST", _TL("Maximum Distance"), _TL(""), PARAMETER_TYPE_Double, 1, 0.0, true);
	m_Settings.Add_String(NULL, "MODEL"  , _TL("Model"           ), _TL(""), SG_T("a + b * x"));
}
//---------------------------------------------------------
bool CSG_3DView_Dialog::Create(CSG_3DView_Panel *pPanel)
{
	m_pPanel		= pPanel;

	m_pCommands		= Add_Button  (_TL("Commands"    ), wxID_ANY);

//	Add_Spacer();
//	m_pBox			= Add_CheckBox(_TL("Bounding Box"), m_pPanel->m_Parameters("DRAW_BOX"  )->asBool());
//	m_pStereo		= Add_CheckBox(_TL("Anaglyph"    ), m_pPanel->m_Parameters("STEREO"    )->asBool());

	Add_Spacer();
	m_pRotate_X		= Add_Slider  (_TL("X-Rotation"  ), m_pPanel->Get_Projector().Get_xRotation() * M_RAD_TO_DEG, -180.0, 180.0);
	m_pRotate_Z		= Add_Slider  (_TL("Z-Rotation"  ), m_pPanel->Get_Projector().Get_zRotation() * M_RAD_TO_DEG, -180.0, 180.0);
	m_pCentral		= Add_Slider  (_TL("Eye Distance"), m_pPanel->Get_Projector().Get_Central_Distance(), 1.0, 2000.0);

	Add_Output(m_pPanel);

	return( true );
}