CLightProbe::CLightProbe( const CXMLTreeNode& aXMLNode ) { for ( int i = 0, l_NumChilds = aXMLNode.GetNumChildren(); i < l_NumChilds; ++i ) { CXMLTreeNode& l_CurrentNode = aXMLNode( i ); std::string lTagName( l_CurrentNode.GetName() ); if (lTagName == "center") mPosition = l_CurrentNode.GetAttribute<Math::Vect3f>( "pos", Math::Vect3f(0.0f) ); if (lTagName == "vertexs") { for ( int j = 0, l_NumVertexs = l_CurrentNode.GetNumChildren(); j < l_NumVertexs; ++j ) { CXMLTreeNode l_VertexNode = l_CurrentNode( j ); std::string lVertexTag( l_VertexNode.GetName() ); if (lVertexTag == "vertex") { Math::Vect3f lPos( l_VertexNode.GetAttribute<Math::Vect3f>( "pos", Math::Vect3f(0.0f) )); Math::Vect2f lUV( l_VertexNode.GetAttribute<Math::Vect2f>( "uv", Math::Vect2f(0.0f) )); Math::Vect3f lDir( lPos - mPosition ); lDir.Normalize(); CLightProbeVertex* v = new CLightProbeVertex(lPos, lUV); std::string lKey( "" ); if (lDir.x > 0.9f) lKey = "x"; if (lDir.x < -0.9f) lKey = "-x"; if (lDir.y > 0.9f) lKey = "y"; if (lDir.y < -0.9f) lKey = "-y"; if (lDir.z > 0.9f) lKey = "z"; if (lDir.z < -0.9f) lKey = "-z"; ASSERT(lKey != "", "LightProbe incorrect.") mVertexs[lKey] = v; } } } } }
void Account::InitExchangeStroe() { boost::filesystem::path lDir(m_ExchangePath); std::string lDataString = boost::gregorian::to_iso_string(AT::AT_Local_Time().date()); if (!boost::filesystem::exists(lDir)) { create_directory(lDir); } lDir /= lDataString; if(!boost::filesystem::exists(lDir)) { create_directory(lDir); } m_TradeVolDB.reset(new SingleDBHandler(lDir.string().c_str())); }
MarketDBWriter::MarketDBWriter(const std::vector<std::string>& aList,const std::string & DBpath) { if(!boost::filesystem::exists(DBpath)) { boost::filesystem::create_directory(DBpath); } for(int i=0;i!= aList.size();++i) { //leveldb::DB*& lpDB = ; //leveldb::Options options; //options.create_if_missing = true; boost::filesystem::path lDir(DBpath); lDir += aList[i]; std::string lSubItemDBPath = lDir.string(); m_DBMap[aList[i]].reset(new AT::SingleDBHandler(lSubItemDBPath.c_str())); } }