| 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 | * trimvertexpool.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 "myassert.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/myassert.h`/ |
| 44 | #include "mystdio.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/mystdio.h`/ |
| 45 | #include "mystring.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/mystring.h`/ |
| 46 | #include "trimvertex.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/trimvertex.h`/ |
| 47 | #include "trimvertpool.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/trimvertpool.h`/ |
| 48 | #include "bufpool.h"cxx . . $ `<file>/lib/database/src/so/nodes/nurbs/head/bufpool.h`/ |
| 49 | |
| 50 | /*---------------------------------------------------------------------------- |
| 51 | * TrimVertexPool::TrimVertexPool |
| 52 | *---------------------------------------------------------------------------- |
| 53 | */ |
| 54 | TrimVertexPoolcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:97:9`!::TrimVertexPoolcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:97:9`!( void ) |
| 55 | : poolcxx . . $ _SoNurbsTrimVertexPool#pool.( sizeof(TrimVertexcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:96:9`!)*3, 32, "Threevertspool" ) |
| 56 | { |
| 57 | // initialize array of pointers to vertex lists |
| 58 | nextvlistslotcxx . . $ _SoNurbsTrimVertexPool#nextvlistslot. = 0; |
| 59 | vlistsizecxx . . $ _SoNurbsTrimVertexPool#vlistsize. = INIT_VERTLISTSIZEcxx . . $ `lib/database/src/so/nodes/nurbs/head/trimvertpool.h:49:9`!; |
| 60 | vlistcxx . . $ _SoNurbsTrimVertexPool#vlist. = new TrimVertex_pcxx . . $ TrimVertex_p#[vlistsizecxx . . $ _SoNurbsTrimVertexPool#vlistsize.]; |
| 61 | } |
| 62 | |
| 63 | /*---------------------------------------------------------------------------- |
| 64 | * TrimVertexPool::~TrimVertexPool |
| 65 | *---------------------------------------------------------------------------- |
| 66 | */ |
| 67 | TrimVertexPoolcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:97:9`!::~cxx . . $ _SoNurbsTrimVertexPool#`~_SoNurbsTrimVertexPool`(49f6e7a06ebc5aa8).TrimVertexPoolcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:97:9`!( void ) |
| 68 | { |
| 69 | // free all arrays of TrimVertices vertices |
| 70 | while( nextvlistslotcxx . . $ _SoNurbsTrimVertexPool#nextvlistslot. ) { |
| 71 | delete[] vlistcxx . . $ _SoNurbsTrimVertexPool#vlist.[--nextvlistslotcxx . . $ _SoNurbsTrimVertexPool#nextvlistslot.]; |
| 72 | } |
| 73 | |
| 74 | // reallocate space for array of pointers to vertex lists |
| 75 | if( vlistcxx . . $ _SoNurbsTrimVertexPool#vlist. ) delete[] vlistcxx . . $ _SoNurbsTrimVertexPool#vlist.; |
| 76 | } |
| 77 | |
| 78 | /*---------------------------------------------------------------------------- |
| 79 | * TrimVertexPool::clear |
| 80 | *---------------------------------------------------------------------------- |
| 81 | */ |
| 82 | void |
| 83 | TrimVertexPoolcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:97:9`!::clearcxx . . $ _SoNurbsTrimVertexPool#clear(49f6e7a06ebc5aa8).( void ) |
| 84 | { |
| 85 | // reinitialize pool of 3 vertex arrays |
| 86 | poolcxx . . $ _SoNurbsTrimVertexPool#pool..clearcxx . . $ _SoNurbsPool#clear(49f6e7a06ebc5aa8).(); |
| 87 | |
| 88 | // free all arrays of TrimVertices vertices |
| 89 | while( nextvlistslotcxx . . $ _SoNurbsTrimVertexPool#nextvlistslot. ) { |
| 90 | delete[] vlistcxx . . $ _SoNurbsTrimVertexPool#vlist.[--nextvlistslotcxx . . $ _SoNurbsTrimVertexPool#nextvlistslot.]; |
| 91 | vlistcxx . . $ _SoNurbsTrimVertexPool#vlist.[nextvlistslotcxx . . $ _SoNurbsTrimVertexPool#nextvlistslot.] = 0; |
| 92 | } |
| 93 | |
| 94 | // reallocate space for array of pointers to vertex lists |
| 95 | if( vlistcxx . . $ _SoNurbsTrimVertexPool#vlist. ) delete[] vlistcxx . . $ _SoNurbsTrimVertexPool#vlist.; |
| 96 | vlistcxx . . $ _SoNurbsTrimVertexPool#vlist. = new TrimVertex_pcxx . . $ TrimVertex_p#[vlistsizecxx . . $ _SoNurbsTrimVertexPool#vlistsize.]; |
| 97 | } |
| 98 | |
| 99 | |
| 100 | /*---------------------------------------------------------------------------- |
| 101 | * TrimVertexPool::get - allocate a vertex list |
| 102 | *---------------------------------------------------------------------------- |
| 103 | */ |
| 104 | TrimVertexcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:96:9`! * |
| 105 | TrimVertexPoolcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:97:9`!::getcxx . . $ _SoNurbsTrimVertexPool#get(181e16c308993fc2).( int n ) |
| 106 | { |
| 107 | TrimVertexcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:96:9`! *v; |
| 108 | if( n == 3 ) { |
| 109 | v = (TrimVertexcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:96:9`! *) poolcxx . . $ _SoNurbsTrimVertexPool#pool..new_buffercxx . . $ _SoNurbsPool#new_buffer(50c7df7de5344ebb).(); |
| 110 | } else { |
| 111 | if( nextvlistslotcxx . . $ _SoNurbsTrimVertexPool#nextvlistslot. == vlistsizecxx . . $ _SoNurbsTrimVertexPool#vlistsize. ) { |
| 112 | vlistsizecxx . . $ _SoNurbsTrimVertexPool#vlistsize. *= 2; |
| 113 | TrimVertex_pcxx . . $ TrimVertex_p# *nvlist = new TrimVertex_pcxx . . $ TrimVertex_p#[vlistsizecxx . . $ _SoNurbsTrimVertexPool#vlistsize.]; |
| 114 | memcpy( nvlist, vlistcxx . . $ _SoNurbsTrimVertexPool#vlist., nextvlistslotcxx . . $ _SoNurbsTrimVertexPool#nextvlistslot. * sizeof(TrimVertex_pcxx . . $ TrimVertex_p#) ); |
| 115 | if( vlistcxx . . $ _SoNurbsTrimVertexPool#vlist. ) delete[] vlistcxx . . $ _SoNurbsTrimVertexPool#vlist.; |
| 116 | vlistcxx . . $ _SoNurbsTrimVertexPool#vlist. = nvlist; |
| 117 | } |
| 118 | v = vlistcxx . . $ _SoNurbsTrimVertexPool#vlist.[nextvlistslotcxx . . $ _SoNurbsTrimVertexPool#nextvlistslot.++] = new TrimVertexcxx . . $ `lib/database/src/so/nodes/nurbs/_defines.h:96:9`![n]; |
| 119 | } |
| 120 | return v; |
| 121 | } |