本文整理汇总了C++中datanode::Pointer::GetBoolProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::GetBoolProperty方法的具体用法?C++ Pointer::GetBoolProperty怎么用?C++ Pointer::GetBoolProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datanode::Pointer
的用法示例。
在下文中一共展示了Pointer::GetBoolProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void mitk::PlanarFigureInteractor::AddPoint(StateMachineAction*, InteractionEvent* interactionEvent)
{
const mitk::InteractionPositionEvent* positionEvent = dynamic_cast<mitk::InteractionPositionEvent*>( interactionEvent );
if ( positionEvent == nullptr )
return;
const DataNode::Pointer node = this->GetDataNode();
const BaseData::Pointer data = node->GetData();
/*
* Added check for "initiallyplaced" due to bug 13097:
*
* There are two possible cases in which a point can be inserted into a PlanarPolygon:
*
* 1. The figure is currently drawn -> the point will be appended at the end of the figure
* 2. A point is inserted at a userdefined position after the initial placement of the figure is finished
*
* In the second case we need to determine the proper insertion index. In the first case the index always has
* to be -1 so that the point is appended to the end.
*
* These changes are necessary because of a mac os x specific issue: If a users draws a PlanarPolygon then the
* next point to be added moves according to the mouse position. If then the user left clicks in order to add
* a point one would assume the last move position is identical to the left click position. This is actually the
* case for windows and linux but somehow NOT for mac. Because of the insertion logic of a new point in the
* PlanarFigure then for mac the wrong current selected point is determined.
*
* With this check here this problem can be avoided. However a redesign of the insertion logic should be considered
*/
bool isFigureFinished = false;
data->GetPropertyList()->GetBoolProperty("initiallyplaced", isFigureFinished);
bool selected = false;
bool isEditable = true;
node->GetBoolProperty("selected", selected);
node->GetBoolProperty("planarfigure.iseditable", isEditable);
if ( !selected || !isEditable )
{
return;
}
mitk::PlanarFigure *planarFigure = dynamic_cast<mitk::PlanarFigure *>(data.GetPointer());
// We can't derive a new control point from a polyline of a Bezier curve
// as all control points contribute to each polyline point.
if (dynamic_cast<PlanarBezierCurve*>(planarFigure) != nullptr && isFigureFinished)
return;
const mitk::PlaneGeometry *planarFigureGeometry = planarFigure->GetPlaneGeometry();
const mitk::AbstractTransformGeometry *abstractTransformGeometry =
dynamic_cast< AbstractTransformGeometry * >( planarFigure->GetGeometry( 0 ) );
if ( abstractTransformGeometry != nullptr)
return;
// If the planarFigure already has reached the maximum number
if ( planarFigure->GetNumberOfControlPoints() >= planarFigure->GetMaximumNumberOfControlPoints() )
{
return;
}
// Extract point in 2D world coordinates (relative to PlaneGeometry of
// PlanarFigure)
Point2D point2D, projectedPoint;
if ( !this->TransformPositionEventToPoint2D( positionEvent, planarFigureGeometry, point2D ) )
{
return;
}
// TODO: check segment of polyline we clicked in
int nextIndex = -1;
// We only need to check which position to insert the control point
// when interacting with a PlanarPolygon. For all other types
// new control points will always be appended
const mitk::BaseRenderer *renderer = interactionEvent->GetSender();
const PlaneGeometry *projectionPlane = renderer->GetCurrentWorldPlaneGeometry();
if (dynamic_cast<mitk::PlanarPolygon*>(planarFigure) && isFigureFinished)
{
nextIndex = this->IsPositionOverFigure(
positionEvent,
planarFigure,
planarFigureGeometry,
projectionPlane,
projectedPoint
);
}
// Add point as new control point
if ( planarFigure->IsPreviewControlPointVisible() )
{
point2D = planarFigure->GetPreviewControlPoint();
}
//.........这里部分代码省略.........