Debian Codegraph @

lib/database/src/so/nodes/nurbs/libnurbs/slicer.c++

raw symbols SCIP
1 /*
2 *
3 * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
27 * Mountain View, CA 94043, or:
28 *
29 * http://www.sgi.com
30 *
31 * For further information regarding this notice, see:
32 *
33 * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
34 *
35 */
36
37 /*
38 * slicer.c++ - $Revision: 1.1.1.1 $
39 * Derrick Burns - 1991
40 */
41
42 #include "glimports.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/glimports.h`/
43 #include "mystdio.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/mystdio.h`/
44 #include "myassert.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/myassert.h`/
45 #include "bufpool.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/bufpool.h`/
46 #include "slicer.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/slicer.h`/
47 #include "backend.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/backend.h`/
48 #include "arc.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/arc.h`/
49 #include "gridtrimvertex.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/gridtrimvertex.h`/
50 #include "trimvertex.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/trimvertex.h`/
51 #include "varray.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/varray.h`/
52
53 Slicercxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:91:9`!::Slicercxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:91:9`!( Backendcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:42:9`! &b )
54 : CoveAndTilercxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:51:9`!( b ), Meshercxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:70:9`!( b ), backendcxx . . $ _SoNurbsSlicer#backend.( b )
55 {
56 }
57
58 Slicercxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:91:9`!::~cxx . . $ _SoNurbsSlicer#`~_SoNurbsSlicer`(49f6e7a06ebc5aa8).Slicercxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:91:9`!()
59 {
60 }
61
62 void
63 Slicercxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:91:9`!::setisolinescxx . . $ _SoNurbsSlicer#setisolines(d4f767463ce0a6b3).( int x )
64 {
65 isolinescxx . . $ _SoNurbsSlicer#isolines. = x;
66 }
67
68 void
69 Slicercxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:91:9`!::setstriptessellationcxx . . $ _SoNurbsSlicer#setstriptessellation(5102ef758adc0ae7).( REALcxx . . $ REAL# x, REALcxx . . $ REAL# y )
70 {
71 assertcxx . . $ `/usr/include/assert.h:50:10`!(x > 0 && y > 0);
72 ducxx . . $ _SoNurbsSlicer#du. = x;
73 dvcxx . . $ _SoNurbsSlicer#dv. = y;
74 setDucxx . . $ _SoNurbsTrimRegion#setDu(9364e6e7bff7660).( ducxx . . $ _SoNurbsSlicer#du. );
75 }
76
77 void
78 Slicercxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:91:9`!::slicecxx . . $ _SoNurbsSlicer#slice(9128f98445bd5a46).( Arc_ptrcxx . . $ Arc_ptr# loop )
79 {
80 loop->markvertscxx . . $ _SoNurbsArc#markverts(49f6e7a06ebc5aa8).();
81
82 Arc_ptrcxx . . $ Arc_ptr# extrema[4];
83 loop->getextremacxx . . $ _SoNurbsArc#getextrema(59a99a3b4d8a62f5).( extrema );
84
85 unsigned int npts = loop->numptscxx . . $ _SoNurbsArc#numpts(b126dc7c1de90089).();
86 TrimRegioncxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:95:9`!::initcxx . . $ _SoNurbsTrimRegion#init(70e90ab071083d89).( npts, extrema[0] );
87
88 Meshercxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:70:9`!::initcxx . . $ _SoNurbsMesher#init(cb2f890c2fdad230).( npts );
89
90 long ulines = uarraycxx . . $ _SoNurbsTrimRegion#uarray..initcxx . . $ _SoNurbsUarray#init(4255774b09936319).( ducxx . . $ _SoNurbsSlicer#du., extrema[1], extrema[3] );
91
92 Varraycxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:100:9`! varraycxx . . $ _SoNurbsVarray#_SoNurbsVarray(49f6e7a06ebc5aa8).;
93 long vlines = varray.initcxx . . $ _SoNurbsVarray#init(4255774b09936319).( dvcxx . . $ _SoNurbsSlicer#dv., extrema[0], extrema[2] );
94 long botv = 0;
95 long topv;
96 TrimRegioncxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:95:9`!::initcxx . . $ _SoNurbsTrimRegion#init(9364e6e7bff7660).( varray.varraycxx . . $ _SoNurbsVarray#varray.[botv] );
97 getGridExtentcxx . . $ _SoNurbsTrimRegion#getGridExtent(c8dc0f09678a362).( &extrema[0]->pwlArccxx . . $ _SoNurbsArc#pwlArc.->ptscxx . . $ _SoNurbsPwlArc#pts.[0], &extrema[0]->pwlArccxx . . $ _SoNurbsArc#pwlArc.->ptscxx . . $ _SoNurbsPwlArc#pts.[0] );
98
99 for( long quad=0; quad<varray.numquadscxx . . $ _SoNurbsVarray#numquads.; quad++ ) {
100 backendcxx . . $ _SoNurbsSlicer#backend..surfgridcxx . . $ _SoNurbsBackend#surfgrid(74c47f24a06ca6fb).( uarraycxx . . $ _SoNurbsTrimRegion#uarray..uarraycxx . . $ _SoNurbsUarray#uarray.[0],
101 uarraycxx . . $ _SoNurbsTrimRegion#uarray..uarraycxx . . $ _SoNurbsUarray#uarray.[ulines-1],
102 ulines-1,
103 varray.vvalcxx . . $ _SoNurbsVarray#vval.[quad],
104 varray.vvalcxx . . $ _SoNurbsVarray#vval.[quad+1],
105 varray.voffsetcxx . . $ _SoNurbsVarray#voffset.[quad+1] - varray.voffsetcxx . . $ _SoNurbsVarray#voffset.[quad] );
106
107 for( long i=varray.voffsetcxx . . $ _SoNurbsVarray#voffset.[quad]+1; i <= varray.voffsetcxx . . $ _SoNurbsVarray#voffset.[quad+1]; i++ ) {
108 topv = botv++;
109 advancecxx . . $ _SoNurbsTrimRegion#advance(bd1040fe176e0786).( topv - varray.voffsetcxx . . $ _SoNurbsVarray#voffset.[quad],
110 botv - varray.voffsetcxx . . $ _SoNurbsVarray#voffset.[quad],
111 varray.varraycxx . . $ _SoNurbsVarray#varray.[botv] );
112 if( i == vlines )
113 getPtscxx . . $ _SoNurbsTrimRegion#getPts(9128f98445bd5a46).( extrema[2] );
114 else
115 getPtscxx . . $ _SoNurbsTrimRegion#getPts(8289e54500eb6aad).( backendcxx . . $ _SoNurbsSlicer#backend. );
116 getGridExtentcxx . . $ _SoNurbsTrimRegion#getGridExtent(49f6e7a06ebc5aa8).();
117 if( isolinescxx . . $ _SoNurbsSlicer#isolines. ) {
118 outlinecxx . . $ _SoNurbsSlicer#outline(49f6e7a06ebc5aa8).();
119 } else {
120 if( canTilecxx . . $ _SoNurbsTrimRegion#canTile(b126dc7c1de90089).() )
121 coveAndTilecxx . . $ _SoNurbsCoveAndTiler#coveAndTile(49f6e7a06ebc5aa8).();
122 else
123 meshcxx . . $ _SoNurbsMesher#mesh(49f6e7a06ebc5aa8).();
124 }
125 }
126 }
127 }
128
129
130 void
131 Slicercxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:91:9`!::outlinecxx . . $ _SoNurbsSlicer#outline(49f6e7a06ebc5aa8).( void )
132 {
133 GridTrimVertexcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:59:9`! uppercxx . . $ _SoNurbsGridTrimVertex#_SoNurbsGridTrimVertex(49f6e7a06ebc5aa8)., lowercxx . . $ _SoNurbsGridTrimVertex#_SoNurbsGridTrimVertex(49f6e7a06ebc5aa8).;
134 Hullcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:63:9`!::initcxx . . $ _SoNurbsHull#init(49f6e7a06ebc5aa8).( );
135
136 backendcxx . . $ _SoNurbsSlicer#backend..bgnoutlinecxx . . $ _SoNurbsBackend#bgnoutline(49f6e7a06ebc5aa8).();
137 while( (nextuppercxx . . $ _SoNurbsHull#nextupper(e25b1b2923294a68).( &upper )) ) {
138 if( upper.isGridVertcxx . . $ _SoNurbsGridTrimVertex#isGridVert(b126dc7c1de90089).() )
139 backendcxx . . $ _SoNurbsSlicer#backend..linevertcxx . . $ _SoNurbsBackend#linevert(b92271667e06870c).( upper.gcxx . . $ _SoNurbsGridTrimVertex#g. );
140 else
141 backendcxx . . $ _SoNurbsSlicer#backend..linevertcxx . . $ _SoNurbsBackend#linevert(e1c1970548bfc28b).( upper.tcxx . . $ _SoNurbsGridTrimVertex#t. );
142 }
143 backendcxx . . $ _SoNurbsSlicer#backend..endoutlinecxx . . $ _SoNurbsBackend#endoutline(49f6e7a06ebc5aa8).();
144
145 backendcxx . . $ _SoNurbsSlicer#backend..bgnoutlinecxx . . $ _SoNurbsBackend#bgnoutline(49f6e7a06ebc5aa8).();
146 while( (nextlowercxx . . $ _SoNurbsHull#nextlower(e25b1b2923294a68).( &lower )) ) {
147 if( lower.isGridVertcxx . . $ _SoNurbsGridTrimVertex#isGridVert(b126dc7c1de90089).() )
148 backendcxx . . $ _SoNurbsSlicer#backend..linevertcxx . . $ _SoNurbsBackend#linevert(b92271667e06870c).( lower.gcxx . . $ _SoNurbsGridTrimVertex#g. );
149 else
150 backendcxx . . $ _SoNurbsSlicer#backend..linevertcxx . . $ _SoNurbsBackend#linevert(e1c1970548bfc28b).( lower.tcxx . . $ _SoNurbsGridTrimVertex#t. );
151 }
152 backendcxx . . $ _SoNurbsSlicer#backend..endoutlinecxx . . $ _SoNurbsBackend#endoutline(49f6e7a06ebc5aa8).();
153 }
154
155
156 void
157 Slicercxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:91:9`!::outlinecxx . . $ _SoNurbsSlicer#outline(9128f98445bd5a46).( Arc_ptrcxx . . $ Arc_ptr# jarc )
158 {
159 jarc->markvertscxx . . $ _SoNurbsArc#markverts(49f6e7a06ebc5aa8).();
160
161 if( jarc->pwlArccxx . . $ _SoNurbsArc#pwlArc.->nptscxx . . $ _SoNurbsPwlArc#npts. >= 2 ) {
162 backendcxx . . $ _SoNurbsSlicer#backend..bgnoutlinecxx . . $ _SoNurbsBackend#bgnoutline(49f6e7a06ebc5aa8).();
163 for( int j = jarc->pwlArccxx . . $ _SoNurbsArc#pwlArc.->nptscxx . . $ _SoNurbsPwlArc#npts.-1; j >= 0; j-- )
164 backendcxx . . $ _SoNurbsSlicer#backend..linevertcxx . . $ _SoNurbsBackend#linevert(e1c1970548bfc28b).( &(jarc->pwlArccxx . . $ _SoNurbsArc#pwlArc.->ptscxx . . $ _SoNurbsPwlArc#pts.[j]) );
165 backendcxx . . $ _SoNurbsSlicer#backend..endoutlinecxx . . $ _SoNurbsBackend#endoutline(49f6e7a06ebc5aa8).();
166 }
167 }
168