Esempio n. 1
0
 ActivationFactory::ActivationFactory() : ConstructionFactory<Activation*>("Activation") {
     registerConstructor("", fl::null);
     registerConstructor(First().className(), &(First::constructor));
     registerConstructor(General().className(), &(General::constructor));
     registerConstructor(Highest().className(), &(Highest::constructor));
     registerConstructor(Last().className(), &(Last::constructor));
     registerConstructor(Lowest().className(), &(Lowest::constructor));
     registerConstructor(Proportional().className(), &(Proportional::constructor));
     registerConstructor(Threshold().className(), &(Threshold::constructor));
 }
Esempio n. 2
0
static void 
GetInitialScaleValues(ScaleWidget sw)
{
    if (sw->scale.proportional) {
	sw->scale.scale_x = sw->scale.scale_y =
	    ((sw->scale.aspect_ratio > 1.0) ?
	     sw->scale.aspect_ratio : 1.0 / sw->scale.aspect_ratio) *
		 (sw->scale.precision > 1.0 ?
		  sw->scale.precision : 1.0);
	Proportional(sw); /* need to cut them down to proper values */
    }
    else
	sw->scale.scale_x = sw->scale.scale_y = 1.0;
}