Skip to content

Commit

Permalink
Cherry-pick #11282: turn off hit testing visibility for DM related re…
Browse files Browse the repository at this point in the history
…nder packages (#11286)

* Fix for regression in multi-output node preview  (#11266)

* fix for multi-output node preview regression

* update tests

* add test

* revert unwanted changes

* update test

* turn off hit testing visibility for DM related render packages (#11282)
  • Loading branch information
aparajit-pratap authored Dec 1, 2020
1 parent 990deef commit c9a267a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/DynamoCoreWpf/ViewModels/Watch3D/HelixWatch3DViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1891,7 +1891,7 @@ private bool UpdateGeometryModelForSpecialRenderPackage(HelixRenderPackage rp, s
var manipulator = model as DynamoGeometryModel3D;
if (null == manipulator)
{
manipulator = CreateDynamoGeometryModel3D(rp);
manipulator = CreateDynamoGeometryModel3D(rp, false);
AttachedProperties.SetIsSpecialRenderPackage(manipulator, true);
}

Expand All @@ -1912,7 +1912,7 @@ private bool UpdateGeometryModelForSpecialRenderPackage(HelixRenderPackage rp, s
var centerline = model as DynamoLineGeometryModel3D;
if (null == centerline)
{
centerline = CreateLineGeometryModel3D(rp, 0.3);
centerline = CreateLineGeometryModel3D(rp, 0.3, false);
AttachedProperties.SetIsSpecialRenderPackage(centerline, true);
}
centerline.Geometry = rp.Lines;
Expand All @@ -1922,7 +1922,7 @@ private bool UpdateGeometryModelForSpecialRenderPackage(HelixRenderPackage rp, s
var plane = model as DynamoLineGeometryModel3D;
if (null == plane)
{
plane = CreateLineGeometryModel3D(rp, 0.7);
plane = CreateLineGeometryModel3D(rp, 0.7, false);
AttachedProperties.SetIsSpecialRenderPackage(plane, true);
}
plane.Geometry = rp.Lines;
Expand Down Expand Up @@ -2029,14 +2029,14 @@ private void CreateOrUpdateText(string baseId, Vector3 pt, IRenderPackage rp)
pt + defaultLabelOffset));
}

private DynamoGeometryModel3D CreateDynamoGeometryModel3D(HelixRenderPackage rp)
private DynamoGeometryModel3D CreateDynamoGeometryModel3D(HelixRenderPackage rp, bool isHitTestVisible = true)
{

var meshGeometry3D = new DynamoGeometryModel3D()
{
Transform = new MatrixTransform3D(rp.Transform.ToMatrix3D()),
Material = WhiteMaterial,
IsHitTestVisible = true,
IsHitTestVisible = isHitTestVisible,
RequiresPerVertexColoration = rp.RequiresPerVertexColoration,
};

Expand Down Expand Up @@ -2070,15 +2070,16 @@ private DynamoGeometryModel3D CreateDynamoGeometryModel3D(HelixRenderPackage rp)
return meshGeometry3D;
}

private DynamoLineGeometryModel3D CreateLineGeometryModel3D(HelixRenderPackage rp, double thickness = 1.0)
private DynamoLineGeometryModel3D CreateLineGeometryModel3D(HelixRenderPackage rp, double thickness = 1.0,
bool isHitTestVisible = true)
{
var lineGeometry3D = new DynamoLineGeometryModel3D()
{
//Do not set Geometry here
Transform = new MatrixTransform3D(rp.Transform.ToMatrix3D()),
Color = Colors.White,
Thickness = thickness,
IsHitTestVisible = true,
IsHitTestVisible = isHitTestVisible,
IsSelected = rp.IsSelected
};
return lineGeometry3D;
Expand Down

0 comments on commit c9a267a

Please sign in to comment.