#923 Intersections: Input points by clicking in 3D view

This commit is contained in:
Magne Sjaastad
2016-10-18 11:57:05 +02:00
parent 6bb0c3b87e
commit 8c3f707758
4 changed files with 94 additions and 21 deletions

View File

@@ -89,14 +89,22 @@ bool RicNewPolylineIntersectionFeature::handleEvent(cvf::Object* eventObject)
if (polylineUiEvent)
{
RimIntersection* crossSection = selection[0];
if (crossSection->inputFromViewerEnabled())
{
RimCase* rimCase = NULL;
crossSection->firstAncestorOrThisOfType(rimCase);
CVF_ASSERT(rimCase);
RimCase* rimCase = NULL;
crossSection->firstAncestorOrThisOfType(rimCase);
CVF_ASSERT(rimCase);
if (crossSection->inputPolyLineFromViewerEnabled())
{
crossSection->appendPointToPolyLine(rimCase->displayModelOffset() + polylineUiEvent->localIntersectionPoint);
// Further Ui processing is stopped when true is returned
return true;
}
else if (crossSection->inputExtrusionPointsFromViewerEnabled())
{
crossSection->appendPointToCustomExtrusion(rimCase->displayModelOffset() + polylineUiEvent->localIntersectionPoint);
// Further Ui processing is stopped when true is returned
return true;
}
@@ -140,7 +148,7 @@ void RicNewPolylineIntersectionFeatureCmd::redo()
RimIntersection* crossSection = new RimIntersection();
crossSection->name = "Polyline";
crossSection->type = RimIntersection::CS_POLYLINE;
crossSection->inputFromViewerEnabled = true;
crossSection->inputPolyLineFromViewerEnabled = true;
m_crossSectionCollection->appendCrossSection(crossSection);