bool EditorBlendModule::readProperties (TiXmlElement *element)
{
	if (!readSourceModules (element))
		return false;

	return true;
}
bool EditorScalePointModule::readProperties (TiXmlElement *element)
{
	TiXmlElement *prop;
	double dval;

	if (!readSourceModules (element))
		return false;

	prop = element->FirstChildElement ("ScaleX");
	if (prop == NULL || prop->QueryDoubleAttribute ("value", &dval) != TIXML_SUCCESS)
		return false;
	mModule.setScaleX (dval);

	prop = element->FirstChildElement ("ScaleY");
	if (prop == NULL || prop->QueryDoubleAttribute ("value", &dval) != TIXML_SUCCESS)
		return false;
	mModule.setScaleY (dval);

	prop = element->FirstChildElement ("ScaleZ");
	if (prop == NULL || prop->QueryDoubleAttribute ("value", &dval) != TIXML_SUCCESS)
		return false;
	mModule.setScaleZ (dval);

	return true;
}
Example #3
0
bool EditorSelectModule::readProperties (TiXmlElement *element)
{
	TiXmlElement *prop;
	double dval;

	if (!readSourceModules (element))
		return false;

	prop = element->FirstChildElement ("LowerBound");
	if (prop == NULL || prop->QueryDoubleAttribute ("value", &dval) != TIXML_SUCCESS)
		return false;
	mModule.setLowerBound (dval);

	prop = element->FirstChildElement ("UpperBound");
	if (prop == NULL || prop->QueryDoubleAttribute ("value", &dval) != TIXML_SUCCESS)
		return false;
	mModule.setUpperBound (dval);

	prop = element->FirstChildElement ("EdgeFalloff");
	if (prop == NULL || prop->QueryDoubleAttribute ("value", &dval) != TIXML_SUCCESS)
		return false;
	mModule.setEdgeFalloff (dval);

	return true;
}
Example #4
0
bool EditorTerraceModule::readProperties (TiXmlElement *element)
{
	int ival;
	TiXmlElement *prop = NULL;
	TiXmlNode *child = NULL;

	if (!readSourceModules (element))
		return false;

	prop = element->FirstChildElement ("Invert");
	if (prop == NULL || prop->QueryIntAttribute ("value", &ival) != TIXML_SUCCESS)
		return false;
	mModule.invert (ival != 0);

	mModule.clearControlPoints ();

	while( (child = element->IterateChildren( "Point", child )) != NULL )
	{
		prop = child->ToElement();
		if (prop)
		{
			double value;
			if (prop->QueryDoubleAttribute ("value", &value) != TIXML_SUCCESS)
				return false;
			mModule.addControlPoint (value);
		}
	}

	mPointCount = mModule.getControlPoints().size();

	return true;
}
bool EditorTurbulenceModule::readProperties (TiXmlElement *element)
{
	TiXmlElement *prop;
	double dval;
	int ival;

	if (!readSourceModules (element))
		return false;

	prop = element->FirstChildElement ("Power");
	if (prop == NULL || prop->QueryDoubleAttribute ("value", &dval) != TIXML_SUCCESS)
		return false;
	mModule.setPower (dval);

	prop = element->FirstChildElement ("Frequency");
	if (prop == NULL || prop->QueryDoubleAttribute ("value", &dval) != TIXML_SUCCESS)
		return false;
	mModule.setFrequency (dval);

	prop = element->FirstChildElement ("Roughness");
	if (prop == NULL || prop->QueryIntAttribute ("value", &ival) != TIXML_SUCCESS)
		return false;
	mModule.setRoughness (ival);

	prop = element->FirstChildElement ("Seed");
	if (prop == NULL || prop->QueryIntAttribute ("value", &ival) != TIXML_SUCCESS)
		return false;
	mModule.setSeed (ival);

	prop = element->FirstChildElement ("Quality");
	if (prop != NULL)
	{
		if (prop->QueryIntAttribute ("value", &ival) != TIXML_SUCCESS)
			return false;
		mModule.setQuality (ival);
	}

	return true;
}