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

C++ scenenode::ScenePath类代码示例

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

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



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

示例1: hashObject

void Grid::hashObject( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	if( path.size() == 2 )
	{
		SceneNode::hashObject( path, context, parent, h );
		h.append( path.back() );
		dimensionsPlug()->hash( h );
		if( path.back() == g_gridLinesName )
		{
			spacingPlug()->hash( h );
			gridColorPlug()->hash( h );
		}
		else if( path.back() == g_centerLinesName )
		{
			centerColorPlug()->hash( h );
		}
		else if( path.back() == g_borderLinesName )
		{
			borderColorPlug()->hash( h );
		}
	}
	else
	{
		h = outPlug()->objectPlug()->defaultValue()->hash();
	}
}
开发者ID:cwmartin,项目名称:gaffer,代码行数:26,代码来源:Grid.cpp


示例2: hashChildNames

void Grid::hashChildNames( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	SceneNode::hashChildNames( path, context, parent, h );
	h.append( (uint64_t)path.size() );

	if( path.size() == 0 )
	{
		namePlug()->hash( h );
	}
}
开发者ID:mattigruener,项目名称:gaffer,代码行数:10,代码来源:Grid.cpp


示例3: if

Imath::Box3f ObjectSource::computeBound( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	Imath::Box3f result;
	IECore::ConstObjectPtr object = sourcePlug()->getValue();

	if( const IECore::VisibleRenderable *renderable = IECore::runTimeCast<const IECore::VisibleRenderable>( object.get() ) )
	{
		result = renderable->bound();
	}
	else if( object->isInstanceOf( IECore::Camera::staticTypeId() ) )
	{
		result = Imath::Box3f( Imath::V3f( -0.5, -0.5, 0 ), Imath::V3f( 0.5, 0.5, 2.0 ) );
	}
	else if( object->isInstanceOf( IECore::CoordinateSystem::staticTypeId() ) )
	{
		result = Imath::Box3f( Imath::V3f( 0 ), Imath::V3f( 1 ) );
	}
	else
	{
		result = Imath::Box3f( Imath::V3f( -0.5 ), Imath::V3f( 0.5 ) );
	}

	if( path.size() == 0 )
	{
		result = Imath::transform( result, transformPlug()->matrix() );
	}
	return result;
}
开发者ID:cedriclaunay,项目名称:gaffer,代码行数:28,代码来源:ObjectSource.cpp


示例4: transformPlug

Imath::M44f ObjectSource::computeTransform( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	if( path.size() == 1 )
	{
		return transformPlug()->matrix();
	}
	return Imath::M44f();
}
开发者ID:Kthulhu,项目名称:gaffer,代码行数:8,代码来源:ObjectSource.cpp


示例5: hashTransform

void ObjectSource::hashTransform( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	SceneNode::hashTransform( path, context, parent, h );
	if( path.size() == 1 )
	{
		transformPlug()->hash( h );
	}
}
开发者ID:Kthulhu,项目名称:gaffer,代码行数:8,代码来源:ObjectSource.cpp


示例6: hashBound

void Light::hashBound( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	SceneNode::hashBound( path, context, parent, h );
	if( path.size() == 0 )
	{
		transformPlug()->hash( h );
	}
}
开发者ID:appleseedhq,项目名称:gaffer,代码行数:8,代码来源:Light.cpp


示例7: transformPlug

Imath::M44f Grid::computeTransform( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	if( path.size() == 1 )
	{
		return transformPlug()->matrix();
	}
	return outPlug()->transformPlug()->defaultValue();
}
开发者ID:cwmartin,项目名称:gaffer,代码行数:8,代码来源:Grid.cpp


示例8: transformPlug

Imath::Box3f Light::computeBound( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	Imath::Box3f result = Imath::Box3f( Imath::V3f( -.5 ), Imath::V3f( .5 ) );
	if( path.size() == 0 )
	{
		result = Imath::transform( result, transformPlug()->matrix() );
	}
	return result;
}
开发者ID:appleseedhq,项目名称:gaffer,代码行数:9,代码来源:Light.cpp


示例9: computeObject

IECore::ConstObjectPtr ObjectSource::computeObject( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	if( path.size() != 1 )
	{
		return parent->objectPlug()->defaultValue();
	}

	return sourcePlug()->getValue();
}
开发者ID:Kthulhu,项目名称:gaffer,代码行数:9,代码来源:ObjectSource.cpp


示例10: hashChildNames

void ObjectSource::hashChildNames( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	if( path.size() == 0 )
	{
		SceneNode::hashChildNames( path, context, parent, h );
		namePlug()->hash( h );
		return;
	}
	h = parent->childNamesPlug()->defaultValue()->Object::hash();
}
开发者ID:Kthulhu,项目名称:gaffer,代码行数:10,代码来源:ObjectSource.cpp


示例11: sourcePlug

Imath::Box3f ObjectSource::computeBound( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	IECore::ConstObjectPtr object = sourcePlug()->getValue();
	Imath::Box3f result = bound( object.get() );

	if( path.size() == 0 )
	{
		result = Imath::transform( result, transformPlug()->matrix() );
	}
	return result;
}
开发者ID:Kthulhu,项目名称:gaffer,代码行数:11,代码来源:ObjectSource.cpp


示例12: hashObject

void ObjectSource::hashObject( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	if( path.size() != 1 )
	{
		h = parent->objectPlug()->defaultValue()->hash();
		return;
	}

	SceneNode::hashObject( path, context, parent, h );
	sourcePlug()->hash( h );
}
开发者ID:Kthulhu,项目名称:gaffer,代码行数:11,代码来源:ObjectSource.cpp


示例13: computeChildNames

IECore::ConstInternedStringVectorDataPtr Grid::computeChildNames( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	if( path.size() <= 1 )
	{
		InternedStringVectorDataPtr resultData = new InternedStringVectorData;
		std::vector<InternedString> &result = resultData->writable();
		if( path.size() == 0 )
		{
			result.push_back( namePlug()->getValue() );
		}
		else
		{
			result.push_back( g_gridLinesName );
			result.push_back( g_centerLinesName );
			result.push_back( g_borderLinesName );
		}
		return resultData;
	}

	return outPlug()->childNamesPlug()->defaultValue();
}
开发者ID:cwmartin,项目名称:gaffer,代码行数:21,代码来源:Grid.cpp


示例14: hashBound

void Grid::hashBound( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	if( path.size() == 0 )
	{
		h = hashOfTransformedChildBounds( path, parent );
	}
	else
	{
		Source::hashBound( path, context, parent, h );
		dimensionsPlug()->hash( h );
	}
}
开发者ID:cwmartin,项目名称:gaffer,代码行数:12,代码来源:Grid.cpp


示例15: unionOfTransformedChildBounds

Imath::Box3f Grid::computeBound( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	if( path.size() == 0 )
	{
		return unionOfTransformedChildBounds( path, parent );
	}
	else
	{
		const V2f halfDimensions = dimensionsPlug()->getValue() / 2.0f;
		const V3f d( halfDimensions.x, halfDimensions.y, 0 );
		return Box3f( -d, d );
	}
}
开发者ID:cwmartin,项目名称:gaffer,代码行数:13,代码来源:Grid.cpp


示例16: computeAttributes

IECore::ConstCompoundObjectPtr Grid::computeAttributes( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	if( path.size() == 1 )
	{
		CompoundObjectPtr result = new CompoundObject;

		result->members()["gl:curvesPrimitive:useGLLines"] = new BoolData( true );
		result->members()["gl:smoothing:lines"] = new BoolData( true );

		ShaderPtr shader = new Shader( "Constant", "gl:surface" );
		shader->parameters()["Cs"] = new Color3fData( Color3f( 1 ) );
		result->members()["gl:surface"] = shader;

		return result;
	}
	else if( path.size() == 2 )
	{
		float pixelWidth = 1.0f;
		if( path.back() == g_gridLinesName )
		{
			pixelWidth = gridPixelWidthPlug()->getValue();
		}
		else if( path.back() == g_centerLinesName )
		{
			pixelWidth = centerPixelWidthPlug()->getValue();
		}
		else if( path.back() == g_borderLinesName )
		{
			pixelWidth = borderPixelWidthPlug()->getValue();
		}

		CompoundObjectPtr result = new CompoundObject;
		result->members()["gl:curvesPrimitive:glLineWidth"] = new FloatData( pixelWidth );

		return result;
	}
	return outPlug()->attributesPlug()->defaultValue();
}
开发者ID:cwmartin,项目名称:gaffer,代码行数:38,代码来源:Grid.cpp


示例17: computeChildNames

IECore::ConstInternedStringVectorDataPtr ObjectSource::computeChildNames( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	if( path.size() == 0 )
	{
		IECore::InternedStringVectorDataPtr result = new IECore::InternedStringVectorData();
		const std::string &name = namePlug()->getValue();
		if( name.size() )
		{
			result->writable().push_back( name );
		}
		else
		{
			result->writable().push_back( "unnamed" );
		}
		return result;
	}
	return parent->childNamesPlug()->defaultValue();
}
开发者ID:Kthulhu,项目名称:gaffer,代码行数:18,代码来源:ObjectSource.cpp


示例18: computeObject

IECore::ConstObjectPtr Grid::computeObject( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	if( path.size() == 2 )
	{
		IntVectorDataPtr vertsPerCurveData = new IntVectorData;
		vector<int> &vertsPerCurve = vertsPerCurveData->writable();

		V3fVectorDataPtr pData = new V3fVectorData;
		pData->setInterpretation( GeometricData::Point );
		vector<V3f> &p = pData->writable();

		bool periodic = false;
		Color3f cs( 1 );

		const V2f halfDimensions = dimensionsPlug()->getValue() / 2.0f;
		if( path.back() == g_gridLinesName )
		{
			const float spacing = spacingPlug()->getValue();
			const V2i n = V2f( halfDimensions / spacing ) - V2f( 0.01 );
			for( int d = 0; d < 2; ++d )
			{
				const int d0 = d;
				const int d1 = d == 0 ? 1 : 0;
				for( int i = -n[d]; i <= n[d]; ++i )
				{
					if( i == 0 )
					{
						continue;
					}
					vertsPerCurve.push_back( 2 );
					V3f e( 0 );
					e[d0] = i * spacing;
					e[d1] = -halfDimensions[d1];
					p.push_back( e );
					e[d1] = halfDimensions[d1];
					p.push_back( e );
				}
			}
			cs = gridColorPlug()->getValue();
		}
		else if( path.back() == g_centerLinesName )
		{
			vertsPerCurve.push_back( 2 );
			p.push_back( V3f( halfDimensions.x, 0, 0 ) );
			p.push_back( V3f( -halfDimensions.x, 0, 0 ) );
			vertsPerCurve.push_back( 2 );
			p.push_back( V3f( 0, halfDimensions.y, 0 ) );
			p.push_back( V3f( 0, -halfDimensions.y, 0 ) );
			cs = centerColorPlug()->getValue();
		}
		else if( path.back() == g_borderLinesName )
		{
			vertsPerCurve.push_back( 4 );
			p.push_back( V3f( -halfDimensions.x, -halfDimensions.y, 0 ) );
			p.push_back( V3f( halfDimensions.x, -halfDimensions.y, 0 ) );
			p.push_back( V3f( halfDimensions.x, halfDimensions.y, 0 ) );
			p.push_back( V3f( -halfDimensions.x, halfDimensions.y, 0 ) );
			periodic = true;
			cs = borderColorPlug()->getValue();
		}

		CurvesPrimitivePtr result = new CurvesPrimitive( vertsPerCurveData, CubicBasisf::linear(), periodic, pData );
		result->variables["Cs"] = PrimitiveVariable( PrimitiveVariable::Constant, new Color3fData( cs ) );
		return result;
	}
	return outPlug()->objectPlug()->defaultValue();
}
开发者ID:cwmartin,项目名称:gaffer,代码行数:67,代码来源:Grid.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ sceneplug::ScenePath类代码示例发布时间:2022-05-31
下一篇:
C++ scenenode::ObjectIterator类代码示例发布时间: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