ReactOS 0.4.16-dev-122-g325d74c
Splinespec Struct Reference
Collaboration diagram for Splinespec:

Public Member Functions

 Splinespec (int)
 
 ~Splinespec (void)
 
void kspecinit (Knotvector &)
 
void kspecinit (Knotvector &, Knotvector &)
 
void select (void)
 
void layout (long)
 
void setupquilt (Quilt_ptr)
 
void copy (INREAL *)
 
void transform (void)
 

Public Attributes

Knotspeckspec
 
int dim
 
REALoutcpts
 

Detailed Description

Definition at line 95 of file tobezier.cc.

Constructor & Destructor Documentation

◆ Splinespec()

Splinespec::Splinespec ( int  dimen)

Definition at line 146 of file tobezier.cc.

147{
148 dim = dimen;
149}

◆ ~Splinespec()

Splinespec::~Splinespec ( void  )

Definition at line 151 of file tobezier.cc.

152{
153 /* Note: do NOT delete 'outcpts' here since its address (not contents)
154 * is copied in 'cpts' in this file in function Splinespec::setupquilt().
155 * This block of memory will eventually be deleted in file quilt.c++ in
156 * function Quilt::deleteMe() through 'cpts' so do NOT delete it here!
157 */
158 Knotspec *ktrav= kspec; //start at beginning of list
159 while (ktrav != 0) { //any items to delete?
160 Knotspec *deleteThis= ktrav; //remember to delete this
161 ktrav= ktrav->next; //go to next item if any
162 delete deleteThis; //delete it
163 }
164} /* ~Splinespec() */
Knotspec * next
Definition: tobezier.cc:75
Knotspec * kspec
Definition: tobezier.cc:98

Member Function Documentation

◆ copy()

void Splinespec::copy ( INREAL incpts)

Definition at line 253 of file tobezier.cc.

254{
255 kspec->copy( incpts, outcpts );
256}
void copy(INREAL *, REAL *)
Definition: tobezier.cc:330
REAL * outcpts
Definition: tobezier.cc:100

Referenced by Quilt::toBezier().

◆ kspecinit() [1/2]

void Splinespec::kspecinit ( Knotvector knotvector)

Definition at line 174 of file tobezier.cc.

175{
176 kspec = new Knotspec;
177 kspec->inkbegin = knotvector.knotlist;
178 kspec->inkend = knotvector.knotlist + knotvector.knotcount;
179 kspec->prestride = (int) knotvector.stride;
180 kspec->order = knotvector.order;
181 kspec->next = NULL;
182}
#define NULL
Definition: types.h:112
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
long order
Definition: tobezier.cc:55
int prestride
Definition: tobezier.cc:68
Knot_ptr inkend
Definition: tobezier.cc:57
Knot_ptr inkbegin
Definition: tobezier.cc:56
long order
Definition: knotvector.h:48
long stride
Definition: knotvector.h:50
long knotcount
Definition: knotvector.h:49
Knot * knotlist
Definition: knotvector.h:51

Referenced by Quilt::toBezier().

◆ kspecinit() [2/2]

void Splinespec::kspecinit ( Knotvector sknotvector,
Knotvector tknotvector 
)

Definition at line 185 of file tobezier.cc.

186{
187 kspec = new Knotspec;
188 Knotspec *tkspec = new Knotspec;
189
190 kspec->inkbegin = sknotvector.knotlist;
191 kspec->inkend = sknotvector.knotlist + sknotvector.knotcount;
192 kspec->prestride = (int) sknotvector.stride;
193 kspec->order = sknotvector.order;
194 kspec->next = tkspec;
195
196 tkspec->inkbegin = tknotvector.knotlist;
197 tkspec->inkend = tknotvector.knotlist + tknotvector.knotcount;
198 tkspec->prestride = (int) tknotvector.stride;
199 tkspec->order = tknotvector.order;
200 tkspec->next = NULL;
201}

◆ layout()

void Splinespec::layout ( long  ncoords)

Definition at line 228 of file tobezier.cc.

229{
230
231 long stride = ncoords;
232 for( Knotspec *knotspec = kspec; knotspec; knotspec=knotspec->next ) {
233 knotspec->poststride = (int) stride;
234 stride *= ((knotspec->bend-knotspec->bbegin)*knotspec->order + knotspec->postoffset);
235 knotspec->preoffset *= knotspec->prestride;
236 knotspec->prewidth *= knotspec->poststride;
237 knotspec->postwidth *= knotspec->poststride;
238 knotspec->postoffset *= knotspec->poststride;
239 knotspec->ncoords = (int) ncoords;
240 }
241 outcpts = new REAL[stride];
242 assert( outcpts != 0 );
243}
float REAL
Definition: types.h:41
#define assert(x)
Definition: debug.h:53
GLsizei stride
Definition: glext.h:5848

Referenced by Quilt::toBezier().

◆ select()

void Splinespec::select ( void  )

Definition at line 212 of file tobezier.cc.

213{
214 for( Knotspec *knotspec = kspec; knotspec; knotspec = knotspec->next ) {
215 knotspec->preselect();
216 knotspec->select();
217 }
218}

Referenced by Quilt::toBezier().

◆ setupquilt()

void Splinespec::setupquilt ( Quilt_ptr  quilt)

Definition at line 266 of file tobezier.cc.

267{
268 Quiltspec_ptr qspec = quilt->qspec;
269 quilt->eqspec = qspec + dim;
270 for( Knotspec *knotspec = kspec; knotspec; knotspec=knotspec->next, qspec++ ) {
271 qspec->stride = knotspec->poststride;
272 qspec->width = knotspec->bend - knotspec->bbegin;
273 qspec->order = (int) knotspec->order;
274 qspec->offset = knotspec->postoffset;
275 qspec->index = 0;
276 qspec->bdry[0] = (knotspec->kleft == knotspec->kfirst) ? 1 : 0;
277 qspec->bdry[1] = (knotspec->kright == knotspec->klast) ? 1 : 0;
278 qspec->breakpoints = new Knot[qspec->width+1];
279 Knot_ptr k = qspec->breakpoints;
280 for( Breakpt *bk = knotspec->bbegin; bk <= knotspec->bend; bk++ )
281 *(k++) = bk->value;
282 }
283 quilt->cpts = outcpts;
284 quilt->next = 0;
285}
REAL * Knot_ptr
Definition: types.h:45
REAL Knot
Definition: types.h:45
int k
Definition: mpi.c:3369
Knot * breakpoints
Definition: quilt.h:59
int index
Definition: quilt.h:56
int bdry[2]
Definition: quilt.h:57
int order
Definition: quilt.h:55
int stride
Definition: quilt.h:52
int offset
Definition: quilt.h:54
int width
Definition: quilt.h:53

Referenced by Quilt::toBezier().

◆ transform()

void Splinespec::transform ( void  )

Definition at line 295 of file tobezier.cc.

296{
297 Knotspec *knotspec;
298 for( knotspec = kspec; knotspec; knotspec=knotspec->next )
299 knotspec->istransformed = 0;
300
301 for( knotspec = kspec; knotspec; knotspec=knotspec->next ) {
302 for( Knotspec *kspec2 = kspec; kspec2; kspec2=kspec2->next )
303 kspec2->kspectotrans = knotspec;
305 knotspec->istransformed = 1;
306 }
307}
void transform(REAL *)
Definition: tobezier.cc:570
int istransformed
Definition: tobezier.cc:74

Referenced by Quilt::toBezier().

Member Data Documentation

◆ dim

int Splinespec::dim

Definition at line 99 of file tobezier.cc.

Referenced by setupquilt(), and Splinespec().

◆ kspec

Knotspec* Splinespec::kspec

Definition at line 98 of file tobezier.cc.

Referenced by copy(), kspecinit(), layout(), select(), setupquilt(), transform(), and ~Splinespec().

◆ outcpts

REAL* Splinespec::outcpts

Definition at line 100 of file tobezier.cc.

Referenced by copy(), layout(), setupquilt(), and transform().


The documentation for this struct was generated from the following file: