本文整理汇总了C++中VarList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ VarList::push_back方法的具体用法?C++ VarList::push_back怎么用?C++ VarList::push_back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VarList
的用法示例。
在下文中一共展示了VarList::push_back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renderDofAmountTest
void renderDofAmountTest()
{
Options opts;
opts.xRes = 320;
opts.yRes = 240;
opts.gridSize = 8;
opts.clipNear = 0.1;
opts.superSamp = Imath::V2i(10,10);
opts.pixelFilter = makeGaussianFilter(Vec2(2.0,2.0));
opts.fstop = 100;
opts.focalLength = 20;
opts.focalDistance = 3;
Attributes attrs;
attrs.shadingRate = 1;
attrs.smoothShading = true;
Mat4 camToScreen =
perspectiveProjection(90, opts.clipNear, opts.clipFar) *
screenWindow(-2.33333, 0.33333, -1, 1);
// Output variables.
VarList outVars;
outVars.push_back(Stdvar::Cs);
Renderer r(opts, camToScreen, outVars);
Mat4 wToO = Mat4().setTranslation(Vec3(-0.5,-0.5,-1)) *
Mat4().setAxisAngle(Vec3(0,0,1), deg2rad(45)) *
Mat4().setTranslation(Vec3(-1.5, 0, 2));
const float P[12] = {0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0};
{
const float Cs[3] = {1, 0.7, 0.7};
r.add(createPatch(P, Cs, wToO), attrs);
}
{
const float Cs[3] = {0.7, 1, 0.7};
r.add(createPatch(P, Cs, Mat4().setTranslation(Vec3(0,0,1))*wToO), attrs);
}
{
const float Cs[3] = {0.7, 0.7, 1};
r.add(createPatch(P, Cs, Mat4().setTranslation(Vec3(0,0,2))*wToO), attrs);
}
{
const float Cs[3] = {1, 0.7, 0.7};
r.add(createPatch(P, Cs, Mat4().setTranslation(Vec3(0,0,5))*wToO), attrs);
}
{
const float Cs[3] = {0.7, 1, 0.7};
r.add(createPatch(P, Cs, Mat4().setTranslation(Vec3(0,0,25))*wToO), attrs);
}
r.render();
}
示例2: read
const bool read( const std::string filename )
{
if ( m_file ) delete m_file;
m_filename = filename;
m_file = new NcFile( filename.c_str(), NcFile::ReadOnly );
if ( !m_file ) return( false );
if ( !m_file->is_valid() ) return( false );
const int ndims = m_file->num_dims();
for ( int i = 0; i < ndims; i++ )
{
m_dims.push_back( new Dim( m_file->get_dim(i) ) );
}
const int nvars = m_file->num_vars();
for ( int i = 0; i < nvars; i++ )
{
m_vars.push_back( new Var( m_file->get_var(i) ) );
}
return( true );
}