本文整理汇总了C++中TextFile::print方法的典型用法代码示例。如果您正苦于以下问题:C++ TextFile::print方法的具体用法?C++ TextFile::print怎么用?C++ TextFile::print使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextFile
的用法示例。
在下文中一共展示了TextFile::print方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cuT
bool SceneNode::TextWriter::operator()( SceneNode const & node, TextFile & file )
{
bool result = node.getName() == cuT( "RootNode" )
|| node.getName() == cuT( "ObjectRootNode" )
|| node.getName() == cuT( "CameraRootNode" );
if ( node.getName() != cuT( "RootNode" )
&& node.getName() != cuT( "ObjectRootNode" )
&& node.getName() != cuT( "CameraRootNode" ) )
{
Logger::logInfo( m_tabs + cuT( "Writing Node " ) + node.getName() );
result = file.writeText( cuT( "\n" ) + m_tabs + cuT( "scene_node \"" ) + node.getName() + cuT( "\"\n" ) ) > 0
&& file.writeText( m_tabs + cuT( "{\n" ) ) > 0;
castor::TextWriter< SceneNode >::checkError( result, "Node name" );
if ( result
&& node.getParent()
&& node.getParent()->getName() != cuT( "RootNode" )
&& node.getParent()->getName() != cuT( "ObjectRootNode" )
&& node.getParent()->getName() != cuT( "CameraRootNode" ) )
{
result = file.writeText( m_tabs + cuT( "\tparent \"" ) + node.getParent()->getName() + cuT( "\"\n" ) ) > 0;
castor::TextWriter< SceneNode >::checkError( result, "Node parent name" );
}
if ( result )
{
result = file.print( 256, cuT( "%s\torientation " ), m_tabs.c_str() ) > 0
&& Quaternion::TextWriter( String() )( node.getOrientation(), file )
&& file.writeText( cuT( "\n" ) ) > 0;
castor::TextWriter< SceneNode >::checkError( result, "Node orientation" );
}
if ( result )
{
result = file.print( 256, cuT( "%s\tposition " ), m_tabs.c_str() ) > 0
&& Point3r::TextWriter( String() )( node.getPosition(), file )
&& file.writeText( cuT( "\n" ) ) > 0;
castor::TextWriter< SceneNode >::checkError( result, "Node position" );
}
if ( result )
{
result = file.print( 256, cuT( "%s\tscale " ), m_tabs.c_str() ) > 0
&& Point3r::TextWriter( String() )( node.getScale(), file )
&& file.writeText( cuT( "\n" ) ) > 0;
castor::TextWriter< SceneNode >::checkError( result, "Node scale" );
}
if ( result )
{
result = file.writeText( m_tabs + cuT( "}\n" ) ) > 0;
castor::TextWriter< SceneNode >::checkError( result, "Node end" );
}
}
if ( result )
{
for ( auto const & it : node.m_children )
{
if ( result
&& it.first.find( cuT( "_REye" ) ) == String::npos
&& it.first.find( cuT( "_LEye" ) ) == String::npos )
{
SceneNodeSPtr node = it.second.lock();
if ( node )
{
result = SceneNode::TextWriter{ m_tabs }( *node, file );
}
}
}
}
return result;
}