Ejemplo n.º 1
0
//******************************************************************
//                    X p a n d   P o i n t
//
//  Evaluates one grid intersection only and advances indexes so
//       the next call will evaluate the next one. 
//******************************************************************
int XpandPoint( SurfaceGrid &Zgrid, ScatData &RandomData )
{  static float Zvalue; 
//assert( xIndex < NumXcoords );
//assert( yIndex < NumYcoords );
if( NumDataPoints < 3 ) return 0;

// Select the closest point in each octant surround the grid point.
SelectPoints( RandomData, Zgrid) ;

// Check if point can be included and if so.. calculate it. 
if ( IncludeGridPoint() > 0 ) Zvalue = WeightedAverage(RandomData); 
else                          Zvalue = UndefinedZ;

Zgrid.zset(xIndex, yIndex, Zvalue ) ;

// Move to next grid intersection....
++xIndex;   
if( xIndex >= NumXcoords )  { ++yIndex; xIndex= 0; } 

if( yIndex >= NumYcoords ){ Locator.New(0, NumXcoords, NumYcoords); return 0; }
++NumberDone;
//assert( NumberDone <= TotalGridPoints);

return 1; 
}
Ejemplo n.º 2
0
void DEMEditGUI::HandleNotifyEvent(void)
{
NotifyTag *Changes, Interested[7];
int Done = 0;
DiagnosticData *Diagnostics;

if (! NativeWin)
	return;

Changes = Activity->ChangeNotify->ChangeList;

Interested[0] = MAKE_ID(WCS_RAHOST_OBJTYPE_DEM, 0xff, 0xff, WCS_NOTIFYCOMP_OBJECT_COUNTCHANGED);
Interested[1] = NULL;
if (GlobalApp->AppEx->MatchNotifyClass(Interested, Changes, 0))
	{
	} // if DEM count changed

Interested[0] = MAKE_ID(WCS_PROJECTCLASS_PREFS, WCS_SUBCLASS_PROJPREFS_UNITS, 0xff, 0xff);
Interested[1] = NULL;
if (GlobalApp->AppEx->MatchNotifyClass(Interested, Changes, 0))
	{
	} // if units changed

if (Active)
	{
	Interested[0] = MAKE_ID(WCS_EFFECTSSUBCLASS_COORDSYS, 0xff, 0xff, 0xff);
	Interested[1] = NULL;
	if (GlobalApp->AppEx->MatchNotifyClass(Interested, Changes, 0))
		{
		ConfigureCoords();
		Done = 1;
		} // if

	Interested[0] = MAKE_ID(Active->GetNotifyClass(), 0xff, 0xff, WCS_NOTIFYCOMP_OBJECT_VALUECHANGED);
	Interested[1] = NULL;
	if (GlobalApp->AppEx->MatchNotifyClass(Interested, Changes, 0))
		{
		DisableWidgets();
		Done = 1;
		} // if

	Interested[0] = MAKE_ID(WCS_NOTIFYCLASS_DIAGNOSTICDATA, WCS_SUBCLASS_DIAGNOSTIC_DATA, 0xff, 0xff);
	Interested[1] = NULL;
	if (GlobalApp->AppEx->MatchNotifyClass(Interested, Changes, 0))
		{
		if (Diagnostics = (DiagnosticData *)Activity->ChangeNotify->NotifyData)
			{
			if (Diagnostics->ValueValid[WCS_DIAGNOSTIC_LATITUDE] && Diagnostics->ValueValid[WCS_DIAGNOSTIC_LONGITUDE])
				SelectPoints(Diagnostics->Value[WCS_DIAGNOSTIC_LATITUDE], Diagnostics->Value[WCS_DIAGNOSTIC_LONGITUDE]);
			} // if
		Done = 1;
		} // if
	} // if

if (! Done)
	ConfigureWidgets();

} // DEMEditGUI::HandleNotifyEvent()