Displaying Selections
Use the function mphviewselection to display the selected geometric entities in a MATLAB figure. This section also includes sections to Specify What to Display with the Selection and Change Display Color and Transparency.
You can either specify the geometric entity index and its entity type or specify the tag of a selection node available in the model.
To display the entity of type entitytype with the index <idx> enter:
mphviewselection(model, <geomtag>, <idx>, entitytype)
where <geomtag> is the geometry node tag, and <idx> is a positive integer array that contains the entity indices. The string entitytype can be one of 'point', 'edge', 'boundary', or 'domain'.
If the model contains a selection node with the tag <seltag>, this selection can be displayed with the command:
mphviewselection(model, <seltag>)
To plot the selection in an existing axes, set the property 'parent' with the axes handle. For instance, the command below displays the selection in the current axis:
mphviewselection(model, <seltag>, 'parent', gca)
Specify What to Display with the Selection
mphviewselection(model, <seltag>, 'showselector', 'off')
mphviewselection(model, <seltag>, 'geommode', 'off')
The property 'vertexmode', 'edgemode' and 'facemode' support the value 'on' or 'off' in order to render the vertex, the edge and the face respectively in the figure, as in this example line:
mphviewselection(model, <seltag>, 'facemode', 'off')
To include vertex, edge, and face numbers, set the property 'vertexlabels', 'facelabels' and 'edgelabels' respectively to 'on'.
Change the marker used to represent the vertex with the property 'facemode'. In the example command below the vertex are represented in the figure with a '+' marker instead of the default '.':
mphviewselection(model, <seltag>, 'marker', '+')
Specify the size of the marker with the property 'edgelabels', you can specify an integer value corresponding to the number of pixels.
Change Display Color and Transparency
To change the color of the edge and the face use the property 'edgecolor' and 'facecolor' respectively. Specify the color of the vertex with the property 'markercolor'. Set the property with a character or using a RGB array. In this example the edges are displayed in blue while the faces are displayed in the color defined by the RGB array (0.5,0.5,0.5):
mphviewselection(model, <seltag>, 'edgecolor', 'b',...
'facecolor', [0.5 0.5 0.5])
Specify the color for the selected edge and face with the properties 'edgecolorselected' and 'facecolorselected' respectively. Specify the color of the selected vertex with the property 'markercolorselected'. Use a character or specify the color by its RGB array. These commands show how to set the edge to a blue color and the face with the color defined by the RGB array (0.5, 0.5,0.5):
mphviewselection(model, <seltag>, 'edgecolorselected', 'b',...
'facecolorselected', [0.5 0.5 0.5])
Specify the color for the vertex, edge, and face labels with the properties 'vertexlabelscolor', 'edgelabelscolor' and 'facelabelscolor' respectively. You can use a character or the RGB array to specify the color.
Control the transparency of the geometry representation with the property 'facealpha'. Set the property with a double included between 0 and 1. Using this command the geometry is displayed with a transparency of 50%:
mphviewselection(model, <seltag>, 'facealpha', 0.5)
Control the transparency of the selector representation with the property 'selectoralpha'. Set the property with a double included between 0 and 1. Using this command, the selector is displayed with plain color:
mphviewselection(model, <seltag>, 'selectoralpha', 1)