当前位置: 首页>>代码示例>>C++>>正文


C++ NodeOperation::determineResolution方法代码示例

本文整理汇总了C++中NodeOperation::determineResolution方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeOperation::determineResolution方法的具体用法?C++ NodeOperation::determineResolution怎么用?C++ NodeOperation::determineResolution使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NodeOperation的用法示例。


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

示例1: determineResolutions

void NodeOperationBuilder::determineResolutions()
{
	/* determine all resolutions of the operations (Width/Height) */
	for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
		NodeOperation *op = *it;
		
		if (op->isOutputOperation(m_context->isRendering()) && !op->isPreviewOperation()) {
			unsigned int resolution[2] = {0, 0};
			unsigned int preferredResolution[2] = {0, 0};
			op->determineResolution(resolution, preferredResolution);
			op->setResolution(resolution);
		}
	}
	
	for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
		NodeOperation *op = *it;
		
		if (op->isOutputOperation(m_context->isRendering()) && op->isPreviewOperation()) {
			unsigned int resolution[2] = {0, 0};
			unsigned int preferredResolution[2] = {0, 0};
			op->determineResolution(resolution, preferredResolution);
			op->setResolution(resolution);
		}
	}
	
	/* add convert resolution operations when needed */
	{
		Links convert_links;
		for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
			const Link &link = *it;
			
			if (link.to()->getResizeMode() != COM_SC_NO_RESIZE) {
				NodeOperation &from_op = link.from()->getOperation();
				NodeOperation &to_op = link.to()->getOperation();
				if (from_op.getWidth() != to_op.getWidth() || from_op.getHeight() != to_op.getHeight())
					convert_links.push_back(link);
			}
		}
		for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); ++it) {
			const Link &link = *it;
			Converter::convertResolution(*this, link.from(), link.to());
		}
	}
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:44,代码来源:COM_NodeOperationBuilder.cpp

示例2: determineResolution

void OutputSocket::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
{
	NodeBase *node = this->getNode();
	if (node->isOperation()) {
		NodeOperation *operation = (NodeOperation *)node;
		if (operation->isResolutionSet()) {
			resolution[0] = operation->getWidth();
			resolution[1] = operation->getHeight();
		}
		else {
			operation->determineResolution(resolution, preferredResolution);
			operation->setResolution(resolution);
		}
	}
}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:15,代码来源:COM_OutputSocket.cpp


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