• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ aiString类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中aiString的典型用法代码示例。如果您正苦于以下问题:C++ aiString类的具体用法?C++ aiString怎么用?C++ aiString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了aiString类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: setTexture

static void setTexture( const String &resolvedPath, const aiString &texPath, CPPCore::TArray<Texture*> &textures ) {
    Texture *tex = new Texture;
    textures.add( tex );
    String texname;
    texname += "file://";
    texname += resolvedPath;
    String temp( texPath.C_Str() ), temp1;
    IO::Uri::normalizePath( temp, '\\', temp1 );
    texname += temp1;

    tex->m_loc = IO::Uri( texname );
    String::size_type pos = texname.rfind( "/" );
    if ( pos != String::npos ) {
        texname = texname.substr( pos, texname.size() - pos );
    }
    if (IO::IOService::getInstance()->fileExists(tex->m_loc)) {
        IO::AbstractFileSystem *fs = IO::IOService::getInstance()->getFileSystem("file");
        IO::Stream *file = fs->open(tex->m_loc, IO::Stream::AccessMode::ReadAccess);
        tex->m_size = file->getSize();
        file->read(tex->m_data, tex->m_size);
        fs->close(&file);
    }
        
    tex->m_textureName = texname;
    tex->m_width = 0;
    tex->m_height = 0;
    tex->m_channels = 0;
    tex->m_data = nullptr;
    tex->m_size = 0;
}
开发者ID:kimkulling,项目名称:osre,代码行数:30,代码来源:AssimpWrapper.cpp


示例2: GetExtensionList

// ------------------------------------------------------------------------------------------------
// Helper function to build a list of all file extensions supported by ASSIMP
void Importer::GetExtensionList(aiString& szOut) const
{
    ASSIMP_BEGIN_EXCEPTION_REGION();
    std::set<std::string> str;
    for (std::vector<BaseImporter*>::const_iterator i =  pimpl->mImporter.begin();i != pimpl->mImporter.end();++i)  {
        (*i)->GetExtensionList(str);
    }

    for (std::set<std::string>::const_iterator it = str.begin();; ) {
        szOut.Append("*.");
        szOut.Append((*it).c_str());

        if (++it == str.end()) {
            break;
        }
        szOut.Append(";");
    }
    ASSIMP_END_EXCEPTION_REGION(void);
}
开发者ID:Chinchilla03,项目名称:assimp,代码行数:21,代码来源:Importer.cpp


示例3: toXFileString

std::string XFileExporter::toXFileString(aiString &name)
{
	std::string str = std::string(name.C_Str());
	std::replace(str.begin(), str.end(), '<', '_');
	std::replace(str.begin(), str.end(), '>', '_');
	std::replace(str.begin(), str.end(), '{', '_');
	std::replace(str.begin(), str.end(), '}', '_');
	std::replace(str.begin(), str.end(), '$', '_');
	return str;
}
开发者ID:CCJY,项目名称:assimp,代码行数:10,代码来源:XFileExporter.cpp


示例4: addTexture

void Material::addTexture(aiString FILEPATH)
{
	int width, height;

	unsigned char* image = SOIL_load_image(FILEPATH.C_Str(), &width, &height, 0, SOIL_LOAD_RGBA);

	p_images.push_back(image);
	p_width.push_back(width);
	p_height.push_back(height);
}
开发者ID:tsrivishnu99,项目名称:PracticeEngine,代码行数:10,代码来源:Material.cpp


示例5: ConvertName

// -----------------------------------------------------------------------------------
// Convert a name to standard XML format
void ConvertName(aiString& out, const aiString& in)
{
	out.length = 0;
	for (unsigned int i = 0; i < in.length; ++i)  {
		switch (in.data[i]) {
			case '<':
				out.Append("&lt;");break;
			case '>':
				out.Append("&gt;");break;
			case '&':
				out.Append("&amp;");break;
			case '\"':
				out.Append("&quot;");break;
			case '\'':
				out.Append("&apos;");break;
			default:
				out.data[out.length++] = in.data[i];
		}
	}
	out.data[out.length] = 0;
}
开发者ID:tonttu,项目名称:assimp,代码行数:23,代码来源:WriteDumb.cpp


示例6: aiStringToString

String^ aiStringToString(aiString str)
{
	// Assimp aiString underlying encoding is UTF-8
	// Windows String underlying encoding is UTF-16
	Encoding^ srcEncoding = Encoding::UTF8;

	const char* pAiData = str.C_Str(); // pointer to the underlying data of he aiString
	array<unsigned char>^ buffer = gcnew array<unsigned char>(str.length);
	for(unsigned int i=0; i<str.length; ++i)
		buffer[i] = pAiData[i];

	return srcEncoding->GetString(buffer);
}
开发者ID:Abancroft,项目名称:paradox,代码行数:13,代码来源:UtilityFunctions.cpp


示例7: writePath

void XFileExporter::writePath(aiString path)
{
	std::string str = std::string(path.C_Str());
	BaseImporter::ConvertUTF8toISO8859_1(str);

	while( str.find( "\\\\") != std::string::npos)
		str.replace( str.find( "\\\\"), 2, "\\");

	while( str.find( "\\") != std::string::npos)
		str.replace( str.find( "\\"), 1, "/");

	mOutput << str;
			
}
开发者ID:CCJY,项目名称:assimp,代码行数:14,代码来源:XFileExporter.cpp


示例8: toXFileString

std::string XFileExporter::toXFileString(aiString &name)
{
    std::string pref = ""; // node name prefix to prevent unexpected start of string
    std::string str = pref + std::string(name.C_Str());
    for (int i=0; i < (int) str.length(); ++i)
    {
        if ((str[i] >= '0' && str[i] <= '9') || // 0-9
            (str[i] >= 'A' && str[i] <= 'Z') || // A-Z
            (str[i] >= 'a' && str[i] <= 'z')) // a-z
            continue;
        str[i] = '_';
    }
    return str;
}
开发者ID:EmilNorden,项目名称:candle,代码行数:14,代码来源:XFileExporter.cpp


示例9: formatTexPath

bool formatTexPath(const aiString& texName, Path& texPath)
{
	if (texName.length == 0)
		return false;

	string name = texName.C_Str();
	name = name.substr(0, name.find_last_of('.')).append(".image");

	std::cout << name << std::endl;

	texPath.composePath(name);

	return true;
}
开发者ID:BrotherhoodOfHam,项目名称:Engine3D,代码行数:14,代码来源:Builder.cpp


示例10: createTexture2D

// TEXTURE2D
vgd::Shp< vgd::node::Texture2D > createTexture2D(	const vgio::Media & media, const boost::filesystem::path pathFilename, const int index, const aiString aiImagePath,
													const aiTextureMapMode mapU, const aiTextureMapMode mapV )
{
	// Compute image path
	std::string imagePathFilenameStr;

	namespace bfs = boost::filesystem;
	const bfs::path imagePathFilename = aiImagePath.C_Str();

	if ( imagePathFilename.is_absolute() )
	{
		imagePathFilenameStr = imagePathFilename.string();
	}
	else // relative path
	{
		const bfs::path rootPath = pathFilename.parent_path();

		imagePathFilenameStr = (rootPath / imagePathFilename).string();
	}

	// Texture node
	using vgd::node::Texture2D;
	vgd::Shp< Texture2D > texture = Texture2D::create( imagePathFilename.filename().string(), (int8)index );

	// IMAGE
	// Gathers the image from the cache.
	vgd::Shp< vgd::basic::IImage > image;
	image = vgio::ImageCache::load( media, imagePathFilenameStr );
	texture->setImage( image );

	// Default values
	texture->setMipmap( true );
	texture->setMinFilter( Texture2D::LINEAR_MIPMAP_LINEAR );
	texture->setMagFilter( Texture2D::LINEAR );

	// WRAPPING
	texture->setWrapS( toEnum(mapU) );
	texture->setWrapT( toEnum(mapV) );

	// FUNCTION
	texture->sethFunction( vgd::node::Texture2D::FUN_MODULATE ); // @todo
	return texture;
}
开发者ID:npapier,项目名称:vgsdk,代码行数:44,代码来源:Loader.cpp


示例11: operator

	bool operator()(const aiString& aiA, const aiString& aiB)const
	{
		std::string a = aiA.C_Str();
		std::string b = aiB.C_Str();
		return a < b;
	}
开发者ID:ruleless,项目名称:aMazing,代码行数:6,代码来源:CommonHelper.hpp


示例12: toString

string toString(const aiString& s) { return s.C_Str(); }
开发者ID:ciechowoj,项目名称:master,代码行数:1,代码来源:loader.cpp


示例13: assimpToCore

inline std::string assimpToCore( const aiString& string ) {
    return std::string( string.C_Str() );
}
开发者ID:AGGA-IRIT,项目名称:Radium-Engine,代码行数:3,代码来源:AssimpWrapper.hpp



注:本文中的aiString类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ aithread类代码示例发布时间:2022-05-31
下一篇:
C++ aiMatrix4x4类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap