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


C++ Transform3D::getVtkMatrix方法代码示例

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


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

示例1: setBoxWidgetSize

/** Set the box widget bounding box to the input box (given in data space)
 */
void InteractiveCropper::setBoxWidgetSize(const DoubleBoundingBox3D& bb_d)
{
	if (!mImage || !mBoxWidget)
		return;

	double bb_hard[6] =
	{ -0.5, 0.5, -0.5, 0.5, -0.5, 0.5 };
	DoubleBoundingBox3D bb_unit(bb_hard);
	Transform3D M = createTransformNormalize(bb_unit, bb_d);
	Transform3D rMd = mImage->get_rMd();
	M = rMd * M;

	vtkTransformPtr transform = vtkTransformPtr::New();
	transform->SetMatrix(M.getVtkMatrix());
	mBoxWidget->SetTransform(transform);
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:18,代码来源:cxInteractiveCropper.cpp

示例2: cross

void GraphicalArrow3D::setValue(Vector3D base, Vector3D normal, double length)
{
	// find an arbitrary vector k perpendicular to normal:
	Vector3D k = cross(Vector3D(1,0,0), normal);
	if (similar(k, Vector3D(0,0,0)))
		k = cross(Vector3D(0,1,0), normal);
	k = k.normalized();
	Transform3D M = createTransformIJC(normal, k, base);

//	std::cout << "GraphicalArrow3D::setValue  " << base << " - " << normal << std::endl;
	Transform3D S = createTransformScale(Vector3D(length,1,1));
	M = M * S;
	// let arrow shape increase slowly with length:
//	source->SetTipLength(0.35/sqrt(length));
//	source->SetTipRadius(0.1*sqrt(length));
//	source->SetShaftRadius(0.03*sqrt(length));
	source->SetTipLength(0.35);
	source->SetTipRadius(0.1*(length));
	source->SetShaftRadius(0.03*(length));
	actor->SetUserMatrix(M.getVtkMatrix());
}
开发者ID:,项目名称:,代码行数:21,代码来源:

示例3: createTransformScale

void GraphicalAxes3D::rescale()
{
	if (!mViewportListener->isListening())
		return;

	double size = mViewportListener->getVpnZoom();
	double axisSize = mSize/size;
	double scale = axisSize / m_vtkAxisLength;

	// NOTE: vtkAxesActor dislikes small values for SetTotalLength, thus we
	// keep that value constant at m_vtkAxisLength and instead scale the transform.
	Transform3D rMq = m_rMt * createTransformScale(Vector3D(scale,scale,scale));

	mActor->SetUserMatrix(rMq.getVtkMatrix());

	for (unsigned i=0; i<mCaption.size(); ++i)
	{
		Vector3D pos = rMq.coord(axisSize*mCaptionPos[i]);
		mCaption[i]->SetAttachmentPoint(pos.begin());
	}
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:21,代码来源:cxGraphicalAxes3D.cpp

示例4: toIgstkTransform

igstk::Transform IgstkTool::toIgstkTransform(Transform3D transform)
{
    igstk::Transform retval;
    retval.ImportTransform(*transform.getVtkMatrix());
    return retval;
}
开发者ID:,项目名称:,代码行数:6,代码来源:


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