本文整理汇总了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);
}
示例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());
}
示例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());
}
}
示例4: toIgstkTransform
igstk::Transform IgstkTool::toIgstkTransform(Transform3D transform)
{
igstk::Transform retval;
retval.ImportTransform(*transform.getVtkMatrix());
return retval;
}