void XMLEntityMappingDefinitionSerializer::parseMatchElement(EntityMappingDefinition& definition, MatchDefinition& matchDef, TiXmlElement* element)
{
	std::string caseType("");
	if (std::string(element->Value()) == std::string("entitymatch")) {
		matchDef.setType("entitytype");
		caseType = "entitytypecase";
	} else if (std::string(element->Value()) == std::string("attributematch")) {
		matchDef.setType("attribute");
		caseType = "attributecase";

/*		const char* tmp =  smElem->Attribute("attribute");
		matchDef.getProperties()["attribute"] = std::string(tmp);*/
	} else if (std::string(element->Value()) == std::string("outfitmatch")) {
		matchDef.setType("outfit");
		caseType = "outfitcase";
	}

	for (TiXmlAttribute* attribute = element->FirstAttribute();
            attribute != 0; attribute = attribute->Next())
    {
    	matchDef.getProperties()[attribute->Name()] = attribute->Value();
	}

	if (!element->NoChildren()) {
		for (TiXmlElement* childElement = element->FirstChildElement();
				childElement != 0; childElement = childElement->NextSiblingElement())
		{
			CaseDefinition caseDef;
			caseDef.setType(caseType);
			parseCaseElement(definition, caseDef, childElement);
			matchDef.getCases().push_back(caseDef);
		}
	}
}
Exemple #2
0
void PlotsBuilder::mapConnection(PlotsBuilder::PlotType pt, QObject* recvr, const char* slot)
{
    #define caseType(tname) case tname : connect(m_widget->build##tname , SIGNAL(clicked(bool)), recvr, slot); break;
    
    switch (pt)
    {
        //2D
        caseType(CartesianGraphCurve);
        caseType(CartesianImplicitCurve);
        caseType(CartesianParametricCurve2D);
        caseType(PolarGraphCurve);
        //3D
        caseType(CartesianParametricCurve3D);
        caseType(CartesianGraphSurface);
        caseType(CartesianImplicitSurface);
        caseType(CartesianParametricSurface);
        caseType(CylindricalGraphSurface);
        caseType(SphericalGraphSurface);
        case(None): break;
    }
}