HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VEX_Sort.vfl
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024
3  * Side Effects Software Inc. All rights reserved.
4  *
5  * Redistribution and use of Houdini Development Kit samples in source and
6  * binary forms, with or without modification, are permitted provided that the
7  * following conditions are met:
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * 2. The name of Side Effects Software may not be used to endorse or
11  * promote products derived from this software without specific prior
12  * written permission.
13  *
14  * THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE `AS IS' AND ANY EXPRESS
15  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17  * NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
18  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
20  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  *----------------------------------------------------------------------------
26  * This file shows how the hdksort() VEX functions can be used.
27  */
28 
29 cvex VEX_Sort()
30 {
31  int a[];
32  float b[];
33  string c[];
34  vector d[];
35  vector4 e[];
36  matrix3 f[];
37  matrix g[];
38  string c2[];
39 
40  a[0] = 3;
41  a[1] = 2;
42  a[2] = 0;
43  a[3] = 1;
44 
45  b[0] = 3;
46  b[1] = 2;
47  b[2] = 0;
48  b[3] = 1;
49 
50  c[0] = "d";
51  c[1] = "c";
52  c[2] = "a";
53  c[3] = "b";
54 
55  d[0] = (vector)3;
56  d[1] = (vector)2;
57  d[2] = (vector)0;
58  d[3] = (vector)1;
59 
60  e[0] = (vector4)3;
61  e[1] = (vector4)2;
62  e[2] = (vector4)0;
63  e[3] = (vector4)1;
64 
65  f[0] = (matrix3)3;
66  f[1] = (matrix3)2;
67  f[2] = (matrix3)0;
68  f[3] = (matrix3)1;
69 
70  g[0] = (matrix)3;
71  g[1] = (matrix)2;
72  g[2] = (matrix)0;
73  g[3] = (matrix)1;
74 
75  hdksort(a);
76  hdksort(b);
77  hdksort(c);
78  hdksort(d);
79  hdksort(e);
80  hdksort(f);
81  hdksort(g);
82 
83  hdksort(a);
84  hdksort(b);
85  hdksort(c);
86  hdksort(d);
87  hdksort(e);
88  hdksort(f);
89  hdksort(g);
90 
91  printf("%g\n%g\n%g\n%g\n%g\n%g\n%g\n", a, b, c, d, e, f, g);
92 
93  c2 = hdkdecimate(c);
94 
95  printf("%g\n", c2);
96 }
auto printf(const S &fmt, const T &...args) -> int
Definition: printf.h:626
GLboolean GLboolean g
Definition: glcorearb.h:1222
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
cvex VEX_Sort()
Definition: VEX_Sort.vfl:29
GLfloat f
Definition: glcorearb.h:1926
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222