예제 #1
0
		CTblPrExChange::CTblPrExChange(XmlUtils::CXmlLiteReader& oReader)
		{
			m_pTblPrEx.Init();
			m_pTblPrEx->m_bTblPrExChange = true;

			fromXML( oReader );
		}
예제 #2
0
    static void  containerFromXml( xmlNodePtr rootNode, InserterIterator  inserter )
    {
        // parse rootNode child then generateObject and insertit
        SLM_ASSERT("rootNode not instanced", rootNode);
        if ( rootNode->children != NULL )
        {
            xmlNodePtr currentNode = XMLParser::nextXMLElement(rootNode->children);
            while (currentNode )
            {
                OSLM_DEBUG(" containerFromXml" << (const char*)currentNode->name << currentNode );
                // dot not create duplicate object
                ::fwData::Object::sptr obj = fromXML(currentNode);

                // append to container
                typedef typename InserterIterator::container_type::value_type SharedPtrConcreteObject;
                SharedPtrConcreteObject cobj;
                cobj = ::boost::dynamic_pointer_cast< typename SharedPtrConcreteObject::element_type >( obj );
                assert ( cobj );
                *inserter = cobj;

                // go to next element
                currentNode = XMLParser::nextXMLElement(currentNode->next);
            }
        }
    }
예제 #3
0
		CTblPrExChange::CTblPrExChange(XmlUtils::CXmlNode& oNode)
		{
			m_pTblPrEx.Init();
			m_pTblPrEx->m_bTblPrExChange = true;

			fromXML( oNode );
		}
예제 #4
0
/*
<FIELD NAME='STATUS' VALUE=''> </FIELD>STATUS/LOCK/CLOSE
*/
int __fastcall ASEditSvr::exeRestfulCommand(WideString asOperation,WideString asParams,WideString &asResult)
{
  PCPtr<PCXML> lParam(new PCXML(asParams));
  PCPtr<PCXML> lResult(new PCXML("<DATASETS/>"));
  String lsID,lsAction,lsField,lsValue;
  _di_IXMLNode lParentNode;
  //<ACTION>DEFAULT</ACTION>
  lParentNode = lParam->SubNode["ACTION"];
  if(lParentNode)
	lsAction = BLNODETEXT(lParentNode).Trim();
  if(lsAction.IsEmpty()) lsAction = "DEFAULT";
   Action = lsAction;
  lParentNode = lParam->SubNode["PARAM"];
  if(lParentNode)
	 lsID = BLNODETEXT(lParentNode).Trim();
  if((!BLSAMESTR(asOperation,"add")) && lsID.IsEmpty()) throw Exception("必须提供ID参数");
  if(BLSAMESTR(asOperation,"add")){
	  Retrieve("-1");
	  lParentNode = lParam->SubNode["DATASETS"];
	  fromXML(lParentNode,true);
	  Save();
	  lParentNode = lResult->SubNode[""];
	  BLNODEATTSET(lParentNode,"ERI",ERI);
	  toXML(lParentNode);
  }
  else if(BLSAMESTR(asOperation,"get")){
	  Retrieve(lsID);
	  lParentNode = lResult->SubNode[""];
	  BLNODEATTSET(lParentNode,"ERI",ERI);
	  toXML(lParentNode);
  }
  else if(BLSAMESTR(asOperation,"set")){
	  Retrieve(lsID);
	  lParentNode = lParam->SubNode["DATASETS"];
	  fromXML(lParentNode,false,true);
	  Save();
	  lParentNode = lResult->SubNode[""];
	  BLNODEATTSET(lParentNode,"ERI",ERI);
	  toXML(lParentNode);
  }
  else
	 throw Exception("错误操作命令" + asOperation);
  asResult = lResult->XML->Text;
  return 1;
}
예제 #5
0
파일: var.cpp 프로젝트: Aspenka/SSD
void Var::importFromXml(QString filePath)
{
    QFile* file = new QFile(filePath);
	if(!file->open(QIODevice::ReadOnly))
    {
        qDebug()<<"Var::Var(QString filePath) - path is incorrect"<<filePath;
    }
	QXmlStreamReader xml(file);
	fromXML(xml);
	file->close();
}
예제 #6
0
bool KisPaintOpPreset::load()
{
    dbgImage << "Load preset " << filename();
    setValid(false);

    if (filename().isEmpty()) {
        return false;
    }

    QImageReader reader(filename(), "PNG");

    QString version = reader.text("version");
    QString preset = reader.text("preset");

    dbgImage << version << preset;

    if (version != "2.2") {
        return false;
    }

    if (!reader.read(&m_d->image))
    {
        dbgImage << "Fail to decode PNG";
        return false;
    }

    //Workaround for broken presets
    //Presets was saved with nested cdata section
    preset.replace("<curve><![CDATA[", "<curve>");
    preset.replace("]]></curve>", "</curve>");

    QDomDocument doc;
    if (!doc.setContent(preset)) {
        return false;
    }
    fromXML(doc.documentElement());
    if (!m_d->settings) {
        return false;
    }
    setValid(true);
    return true;
}
예제 #7
0
파일: CxnSp.cpp 프로젝트: ShockwaveNN/core
		const CxnSp& CxnSp::operator =(XmlUtils::CXmlNode& node)
		{
			fromXML(node);
			return *this;
		}
예제 #8
0
파일: CxnSp.cpp 프로젝트: ShockwaveNN/core
		CxnSp::CxnSp(XmlUtils::CXmlNode& node)
		{
			fromXML(node);
		}
예제 #9
0
		const Path& Path::operator = (const XML::XNode& node)
		{
			fromXML(node);
			return *this;
		}
예제 #10
0
		Path::Path(const XML::XNode& node)
		{
			fromXML(node);
		}
예제 #11
0
		MajorFont::MajorFont(const XML::XNode& node)
		{
			fromXML(node);
		}
예제 #12
0
		const EffectStyle& EffectStyle::operator =(XmlUtils::CXmlNode& node)
		{
			fromXML(node);
			return *this;
		}
void KisBrightnessContrastFilterConfiguration::fromLegacyXML(const QDomElement& root)
{
    fromXML(root);
}
예제 #14
0
		const Wrap& Wrap::operator = (const XML::XNode& node)
		{
			fromXML(node);
			return *this;
		}
예제 #15
0
		const NvGrpSpPr& NvGrpSpPr::operator =(XmlUtils::CXmlNode& node)
		{
			fromXML(node);
			return *this;
		}
예제 #16
0
		NvGrpSpPr::NvGrpSpPr(XmlUtils::CXmlNode& node)
		{
			fromXML(node);
		}
		const TableStyleProperties& TableStyleProperties::operator =(const XML::XNode& node)
		{
			fromXML(node);
			return *this;
		}
		TableStyleProperties::TableStyleProperties(const XML::XNode& node)
		{
			fromXML(node);
		}
예제 #19
0
파일: CxnSp.cpp 프로젝트: ShockwaveNN/core
		CxnSp::CxnSp(XmlUtils::CXmlLiteReader& oReader)
		{
			fromXML(oReader);
		}
const Shading& Shading::operator =(const XML::XNode& node)
{
    fromXML(node);
    return *this;
}
예제 #21
0
파일: CxnSp.cpp 프로젝트: ShockwaveNN/core
		const CxnSp& CxnSp::operator =(XmlUtils::CXmlLiteReader& oReader)
		{
			fromXML(oReader);
			return *this;
		}
예제 #22
0
		const MajorFont& MajorFont::operator =(const XML::XNode& node)
		{
			fromXML(node);
			return *this;
		}
예제 #23
0
		Wrap::Wrap(const XML::XNode& node)
		{
			fromXML(node);
		}
예제 #24
0
		Graphic::Graphic(const XML::XNode& node)
		{
			fromXML(node);
		}
Shading::Shading(const XML::XNode& node)
{
    fromXML(node);
}
예제 #26
0
		const Graphic& Graphic::operator =(const XML::XNode& node)
		{
			fromXML(node);
			return *this;
		}
예제 #27
0
		EffectStyle::EffectStyle(XmlUtils::CXmlNode& node)
		{
			fromXML(node);
		}
예제 #28
0
		TextBox::TextBox(const XML::XNode& node)
		{
			fromXML(node);
		}
예제 #29
0
bool anim::fromXMLElement(XMLElement* elem)
{
	const char* cName = elem->Name();
	if(cName == NULL) return false;
	string sName = cName;
	if(sName == "rot")
	{
		type |= ANIM_ROT;
		
		min.x = 0;
		max.x = 0;
		speed.SetZero();
		dirx = true;
		pingpong = false;
		
		elem->QueryBoolAttribute("pingpong", &pingpong);
		elem->QueryFloatAttribute("min", &min.x);
		elem->QueryFloatAttribute("max", &max.x);
		elem->QueryFloatAttribute("speed", &speed.x);
		
		if(speed.x < 0)
		{
			speed.x = -speed.x;
			dirx = false;
		}
	}
	else if(sName == "frameseq")
	{
		type |= ANIM_FRAMESEQ;
	
		float32 fps = 0;
		
		elem->QueryFloatAttribute("fps", &fps);
		elem->QueryFloatAttribute("repeat", &repeat);
		elem->QueryFloatAttribute("repeatvar", &repeatvar);
		
		if(fps <= 0) fps = 60;
		framedelay = 1.0/fps;
		
		for(XMLElement* fr = elem->FirstChildElement("frame"); fr != NULL; fr = fr->NextSiblingElement("frame"))
		{
			const char* cImg = fr->Attribute("img");
			if(cImg == NULL) return false;
			Image* img = getImage(cImg);
			frames.push_back(img);
		}
		
		nextAnim = curTime + repeat + randFloat(-repeatvar, repeatvar);
		nextFrame = 0;
		curFrame = frames.end();
	}
	else if(sName == "velfac")	//Item dependant on velocity
	{
		type |= ANIM_VELFAC;
		
		elem->QueryFloatAttribute("min", &minrot);
		elem->QueryFloatAttribute("max", &maxrot);
		elem->QueryFloatAttribute("mul", &rotmul);
		elem->QueryBoolAttribute("add", &rotadd);
		const char* cAxis = elem->Attribute("axis");
		if(cAxis != NULL)
			axis = cAxis;
	}
	else if(sName == "size" || sName == "pos" || sName == "center" || sName == "shear")
	{
		if(sName == "size")
			type |= ANIM_SIZE;
		else if(sName == "pos")
			type |= ANIM_POS;
		else if(sName == "center")
			type |= ANIM_CENTER;
		else if(sName == "shear")
			type |= ANIM_SHEAR;
		
		min.SetZero();
		max.SetZero();
		speed.SetZero();
		dirx = diry = true;
		pingpong = false;
		
		elem->QueryBoolAttribute("pingpong", &pingpong);
		const char* cMin = elem->Attribute("min");
		if(cMin != NULL)
			min = pointFromString(cMin);
		const char* cMax = elem->Attribute("max");
		if(cMax != NULL)
			max = pointFromString(cMax);
		const char* cSpeed = elem->Attribute("speed");
		if(cSpeed != NULL)
			speed = pointFromString(cSpeed);
		
		if(speed.x < 0)
		{
			speed.x = -speed.x;
			dirx = false;
		}
		if(speed.y < 0)
		{
			speed.y = -speed.y;
			diry = false;
		}
	}
	else if(sName == "file")	//Defines an animation in a file elsewhere
	{
		const char* cPath = elem->Attribute("path");
		if(cPath == NULL) return false;
		return fromXML(cPath);	//Create animation from XML. We can get crazy recursive here if we want to design everything that stupid.
	}
	//else if(sName == "")	//TODO: Support more animation types
	else return false;
	
	return true;
}
예제 #30
0
		const TextBox& TextBox::operator = (const XML::XNode& node)
		{
			fromXML(node);
			return *this;
		}