| MESH toolbox 0.1 Matlab/Octave mesh utils

- Main Page
- Related Pages
- Modules
- Files

- File List
- File Members

All Files Functions Groups Pages
PlotMeshTriangleNumber.m
Go to the documentation of this file.
1 function PlotMeshTriangleNumber(varargin)
2 % PlotMeshTriangleNumber(varargin)
3 % Write mesh triangles numbers on figure
4 %
5 % parameters:
6 % Th : mesh structure
7 % BackgroundColor : set triangles numbers background box colors
8 % EdgeColor : set triangles numbers box edge color
9 % Color : set triangles numbers colors
10 % FontSize : set triangles numbers font size
11 %
12 % Example:
13 % @verbatim
14 % PlotMeshNodeNumber(Th,'Color',[1 0 0]);@endverbatim
15 % \image html images/PlotBounds.png "figure : PlotBounds(Th,\'LineWidth\',2);"
16 %
17 % See also:
18 %
19 p = inputParser;
20 p.addRequired('Th', @isstruct);
21 %
22 p.addParamValue('BackgroundColor', [1 1 1], @isnumeric );
23 p.addParamValue('FontSize', 10, @isnumeric );
24 p.addParamValue('Color', [0 0 0] , @isnumeric );
25 p.addParamValue('EdgeColor', [0 0 0] , @isnumeric );
26 p.parse(varargin{:});
27
28 q=p.Results.Th.q;
29 me=p.Results.Th.me;
30 nme=p.Results.Th.nme;
31 PrevHold=SetHoldOn(true);
32 C=(q(:,me(1,:))+q(:,me(2,:))+q(:,me(3,:)))/3;
33 text(C(1,:),C(2,:),num2str([1:nme]'), ...
34 'BackgroundColor',p.Results.BackgroundColor,'Color',p.Results.Color, ...
35 'FontSize',p.Results.FontSize,'EdgeColor', p.Results.EdgeColor, ...
36 'HorizontalAlignment','center');
37 RestoreHold(PrevHold)