Example #1
0
//---------------------------------------------------------
void CTC_Classification::Set_LUT(CSG_Grid *pLandforms, int nLevels)
{
	CSG_Parameter	*pLUT	= DataObject_Get_Parameter(pLandforms, "LUT");

	if( !pLUT || !pLUT->asTable() )
	{
		return;
	}

	pLUT->asTable()->Del_Records();

	switch( nLevels )
	{
	case 1:		// 8 classes
		//        l  s  c  t
		ADD_CLASS(1, 1, 1, 1, 0x7F4633, "steep"     );	// class  1
		ADD_CLASS(1, 1, 1, 0, 0xFF00FF, "steep"     );	// class  2
		ADD_CLASS(1, 1, 0, 1, 0xC16E2E, "steep"     );	// class  3
		ADD_CLASS(1, 1, 0, 0, 0xFC97CF, "steep"     );	// class  4

		ADD_CLASS(1, 0, 1, 1, 0x66A726, "gentle"    );	// class  5
		ADD_CLASS(1, 0, 1, 0, 0xFFFF40, "gentle"    );	// class  6
		ADD_CLASS(1, 0, 0, 1, 0xAEFF7B, "gentle"    );	// class  7
		ADD_CLASS(1, 0, 0, 0, 0xFFFFBF, "gentle"    );	// class  8
		break;

	case 2:		// 12 classes
		ADD_CLASS(1, 1, 1, 1, 0x7F4633, "steep"     );	// class  1
		ADD_CLASS(1, 1, 1, 0, 0xFF00FF, "steep"     );	// class  2
		ADD_CLASS(1, 1, 0, 1, 0xC16E2E, "steep"     );	// class  3
		ADD_CLASS(1, 1, 0, 0, 0xFC97CF, "steep"     );	// class  4

		ADD_CLASS(2, 1, 1, 1, 0xFA9600, "moderate"  );	// class  5
		ADD_CLASS(2, 1, 1, 0, 0xFD43A8, "moderate"  );	// class  6
		ADD_CLASS(2, 1, 0, 1, 0xFBCF66, "moderate"  );	// class  7
		ADD_CLASS(2, 1, 0, 0, 0xF9C4D4, "moderate"  );	// class  8

		ADD_CLASS(2, 0, 1, 1, 0x66A726, "gentle"    );	// class  9
		ADD_CLASS(2, 0, 1, 0, 0xFFFF40, "gentle"    );	// class 10
		ADD_CLASS(2, 0, 0, 1, 0xAEFF7B, "gentle"    );	// class 11
		ADD_CLASS(2, 0, 0, 0, 0xFFFFBF, "gentle"    );	// class 12
		break;

	default:	// 16 classes
		ADD_CLASS(1, 1, 1, 1, 0x7F4633, "very steep");	// class  1
		ADD_CLASS(1, 1, 1, 0, 0xFF00FF, "very steep");	// class  2
		ADD_CLASS(1, 1, 0, 1, 0xC16E2E, "very steep");	// class  3
		ADD_CLASS(1, 1, 0, 0, 0xFC97CF, "very steep");	// class  4

		ADD_CLASS(2, 1, 1, 1, 0xFA9600, "steep"     );	// class  5
		ADD_CLASS(2, 1, 1, 0, 0xFD43A8, "steep"     );	// class  6
		ADD_CLASS(2, 1, 0, 1, 0xFBCF66, "steep"     );	// class  7
		ADD_CLASS(2, 1, 0, 0, 0xF9C4D4, "steep"     );	// class  8

		ADD_CLASS(3, 1, 1, 1, 0x019E73, "moderate"  );	// class  9
		ADD_CLASS(3, 1, 1, 0, 0xC4B71D, "moderate"  );	// class 10
		ADD_CLASS(3, 1, 0, 1, 0x0072B1, "moderate"  );	// class 11
		ADD_CLASS(3, 1, 0, 0, 0xD7D700, "moderate"  );	// class 12

		ADD_CLASS(3, 0, 1, 1, 0xA0FD8E, "gentle"    );	// class 13
		ADD_CLASS(3, 0, 1, 0, 0xE9E915, "gentle"    );	// class 14
		ADD_CLASS(3, 0, 0, 1, 0x003B5B, "gentle"    );	// class 15
		ADD_CLASS(3, 0, 0, 0, 0xF2FEC0, "gentle"    );	// class 16
		break;
	}

	DataObject_Set_Parameter(pLandforms, pLUT);
	DataObject_Set_Parameter(pLandforms, "COLORS_TYPE", 1);	// Color Classification Type: Lookup Table
}
Example #2
0
void ZModInit_CGsp()
{
	ZTvarp zv = ZAlloc(ZTvar,450);

	ADD_CLASS(ZBox,"Box");
	ADD_CLASS(ZCapsule,"Capsule");
	ADD_CLASS(ZChamferCyl,"ChamferCyl");
	ADD_CLASS(ZCone,"Cone");
	ADD_CLASS(ZCylinder,"Cylinder");
	ADD_CLASS(ZLathe,"Lathe");
	ADD_CLASS(ZPlane,"Plane");
	ADD_CLASS(ZPyramid,"Pyramid");
	ADD_CLASS(ZSphere,"Sphere");
	ADD_CLASS(ZSpindle,"Spindle");
	ADD_CLASS(ZSpring,"Spring");
	ADD_CLASS(ZTorus,"Torus");
	ADD_CLASS(ZTube,"Tube");

	ADD_CLASS(ZBevel,"Bevel");
	ADD_CLASS(ZExtrude,"Extrude");
	ADD_CLASS(ZOutline,"Outline");

	ADD_CLASS(ZBend,"Bend");
	ADD_CLASS(ZBulge,"Bulge");
	ADD_CLASS(ZCylindrical_Wave,"Cylindrical_Wave");
	ADD_CLASS(ZLinear_Wave,"Linear_Wave");
	//ADD_CLASS(ZMorph,"Morph");
	//ADD_CLASS(ZNoise,"Noise");
	ADD_CLASS(ZSkew,"Skew");
	ADD_CLASS(ZSmooth,"Smooth");
	ADD_CLASS(ZSpherify,"Spherify");
	ADD_CLASS(ZSqueeze,"Squeeze");
	ADD_CLASS(ZStretch,"Stretch");
	ADD_CLASS(ZTaper,"Taper");
	ADD_CLASS(ZTriangulate,"Triangulate");
	ADD_CLASS(ZTwist,"Twist");

	ADD_CLASS(ZRigidBodySimulation,"PhysicsSimulation");
	ADD_CLASS(ZKeyFrame,"KeyFrameAnimation");

	ZTvarS zvs;
	ZTOInstance zin;

	
	ADD_CLASS(ZAxis  ,"__ZAxis");
	ADD_VAR( ZAxis (X_ax) , _ZC("XAxis") );
	ADD_VAR( ZAxis (Y_ax) , _ZC("YAxis") );
	ADD_VAR( ZAxis (Z_ax) , _ZC("ZAxis") );
	
	ADD_CLASS(ZMath ,"__Math");
	ADD_CLASS(ZMatrix ,"__Matrix");
	ADD_VAR( ZMath () , _ZC("ZMath") );
	ADD_VAR( ZMatrix () , _ZC("ZMatrix") );

	ADD_VAR( ZBulgeType (BRadial) , _ZC("BRadial") );
	ADD_VAR( ZBulgeType (BLinear) , _ZC("BLinear") );

	ADD_CLASS(ZBulgeType,"ZBulgeType");
	ADD_CLASS(ZPoint ,"ZPoint");
	
	ADD_CLASS(ZFile ,"File");
	
	

}