Debian Codegraph @

packages/seacas/applications/blot/idedge.f

raw
1 C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6
7 C=======================================================================
8 SUBROUTINE IDEDGE (IEDSET, NEDGES, HIDENP, LINSET, LENL, IXLIN,
9 * MREF, LREF)
10 C=======================================================================
11
12 C --*** IDEDGE *** (MESH) Identify 3D lines on edge of visible mesh
13 C -- Written by Amy Gilkey - revised 10/02/86
14 C --
15 C --IDEDGE finds edges from IEDSET in the line set and marks them as
16 C --"must draw" with a -n in LINSET(3,x).
17 C --
18 C --Parameters:
19 C -- IEDSET - IN - the edge line set;
20 C -- (0) = face defining edge; 0 to delete edge
21 C -- NEDGES - IN - the number of lines in the edge set
22 C -- HIDENP - IN/OUT - node status (as in HIDDEN)
23 C -- LINSET - IN/OUT - the sorted line set
24 C -- LENL - IN - the length of the line set
25 C -- IXLIN - SCRATCH - index line set to be searched, length = LENL
26
27 PARAMETER (KNVIS=0, KNFOVR=10, KNHID=100)
28
29 include 'debug.blk'
30 include 'd3nums.blk'
31
32 INTEGER IEDSET(0:2,*)
33 INTEGER HIDENP(*)
34 INTEGER LINSET(LLNSET,*)
35 INTEGER IXLIN(*)
36 INTEGER MREF(*), LREF(*)
37
38 C --Get indices of line set to search and order line set nodes
39
40 LENIX = 0
41 DO 100 IL = 1, LENL
42 IF (LINSET(3,IL) .GE. 1) THEN
43 LENIX = LENIX + 1
44 IXLIN(LENIX) = IL
45 IF (LINSET(3,IL) .EQ. 1) THEN
46 IF (LINSET(1,IL) .GT. LINSET(2,IL)) THEN
47 IF (HIDENP(LINSET(1,IL)) .GT. KNVIS) THEN
48 I = LINSET(1,IL)
49 LINSET(1,IL) = LINSET(2,IL)
50 LINSET(2,IL) = I
51 END IF
52 END IF
53 END IF
54 END IF
55 100 CONTINUE
56
57 C ... For each node, mref is first linset edge referencing that node
58 C lref is last linset edge referencing that node
59 call iniint(numnpf, 0, mref)
60 call iniint(numnpf, 0, lref)
61 DO IX=LENIX, 1, -1
62 IL = IXLIN(IX)
63 MREF(LINSET(1,IL)) = IX
64 MREF(LINSET(2,IL)) = IX
65 END DO
66 DO IX=1,LENIX
67 IL = IXLIN(IX)
68 LREF(LINSET(1,IL)) = IX
69 LREF(LINSET(2,IL)) = IX
70 END DO
71
72 DO 130 IEDG = 1, NEDGES
73 IF (IEDSET(0,IEDG) .EQ. 0) GOTO 130
74
75 C --Make sure edge set is still ordered (some nodes may have become
76 C --visible)
77
78 N1 = IEDSET(1,IEDG)
79 N2 = IEDSET(2,IEDG)
80 IF (N1 .GT. N2) THEN
81 IF (HIDENP(N1) .GT. KNVIS) THEN
82 I = N1
83 N1 = N2
84 N2 = I
85 END IF
86 END IF
87
88 C --Find edge in ordered line set
89
90 imax = min(lref(n1), lref(n2), lenix)
91 imin = max(mref(n1), mref(n2), 1)
92 DO 110 IX = imin, imax
93 IL = IXLIN(IX)
94 IF (LINSET(1,IL) .EQ. N1 .and.
95 * LINSET(2,IL) .EQ. N2) THEN
96 C --Mark line set as an edge
97 LINSET(3,IL) = - LINSET(3,IL)
98 GO TO 130
99 END IF
100 110 CONTINUE
101 130 CONTINUE
102
103 RETURN
104 END