Vuo  2.3.2
VuoMesh.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "VuoColor.h"
13 #include "VuoPoint2d.h"
14 #include "VuoPoint3d.h"
15 #include "VuoPoint4d.h"
16 #include "VuoList_VuoColor.h"
17 #include "VuoList_VuoPoint2d.h"
18 #include "VuoList_VuoPoint3d.h"
19 
31 typedef enum {
39 
43 typedef enum {
48 
57 typedef const struct { void *l; } * VuoMesh;
58 
59 // Constructors
65 VuoMesh VuoMesh_make_VuoPoint2d(VuoList_VuoPoint2d positions, VuoList_VuoColor colors, VuoMesh_ElementAssemblyMethod elementAssemblyMethod, VuoReal primitiveSize);
66 VuoMesh VuoMesh_make_VuoPoint3d(VuoList_VuoPoint3d positions, VuoList_VuoColor colors, VuoMesh_ElementAssemblyMethod elementAssemblyMethod, VuoReal primitiveSize);
67 
68 void VuoMesh_allocateCPUBuffers(unsigned int vertexCount,
69  float **positions, float **normals, float **textureCoordinates, float **colors,
70  unsigned int elementCount, unsigned int **elements);
71 
72 VuoMesh VuoMesh_makeFromCPUBuffers(unsigned int vertexCount,
73  float *positions, float *normals, float *textureCoordinates, float *colors,
74  unsigned int elementCount, unsigned int *elements, VuoMesh_ElementAssemblyMethod elementAssemblyMethod);
75 VuoMesh VuoMesh_makeFromGPUBuffers(unsigned int vertexCount,
76  unsigned int combinedBuffer, unsigned int combinedBufferSize,
77  void *normalOffset, void *textureCoordinateOffset, void *colorOffset,
78  unsigned int elementCount, unsigned int elementBuffer, unsigned int elementBufferSize, VuoMesh_ElementAssemblyMethod elementAssemblyMethod);
79 
80 VuoMesh VuoMesh_copy(const VuoMesh mesh);
82 
83 // Mutators
85 
86 // Getters
87 void VuoMesh_getCPUBuffers(const VuoMesh mesh, unsigned int *vertexCount,
88  float **positions, float **normals, float **textureCoordinates, float **colors,
89  unsigned int *elementCount, unsigned int **elements);
90 void VuoMesh_getGPUBuffers(const VuoMesh mesh, unsigned int *vertexCount,
91  unsigned int *combinedBuffer,
92  void **normalOffset, void **textureCoordinateOffset, void **colorOffset,
93  unsigned int *elementCount, unsigned int *elementBuffer);
94 
97 unsigned int VuoMesh_getFaceCullingGL(const VuoMesh mesh);
99 
100 unsigned long VuoMesh_getGlMode(const VuoMesh mesh);
101 unsigned long VuoMesh_getSplitPrimitiveCount(const VuoMesh mesh);
102 unsigned long VuoMesh_getSplitVertexCount(const VuoMesh mesh);
103 unsigned long VuoMesh_getCompleteElementCount(const VuoMesh mesh);
104 unsigned int VuoMesh_getElementBufferSize(const VuoMesh mesh);
105 
106 // Setters
107 void VuoMesh_setCPUBuffers(VuoMesh mesh, unsigned int vertexCount,
108  float *positions, float *normals, float *textureCoordinates, float *colors,
109  unsigned int elementCount, unsigned int *elements);
110 void VuoMesh_setFaceCulling(VuoMesh mesh, VuoMesh_FaceCulling faceCulling);
111 void VuoMesh_setPrimitiveSize(VuoMesh mesh, VuoReal primitiveSize);
112 
114 VuoBox VuoMesh_bounds(const VuoMesh mesh, float matrix[16]);
115 bool VuoMesh_isPopulated(const VuoMesh mesh);
116 
118 struct json_object * VuoMesh_getJson(const VuoMesh value);
119 
121 #define VuoMesh_REQUIRES_INTERPROCESS_JSON
122 struct json_object * VuoMesh_getInterprocessJson(const VuoMesh value);
123 
124 char * VuoMesh_getSummary(const VuoMesh value);
125 
130 {
131  if (inputMode == VuoMesh_IndividualTriangles
132  || inputMode == VuoMesh_TriangleFan
133  || inputMode == VuoMesh_TriangleStrip)
135  else if (inputMode == VuoMesh_IndividualLines
136  || inputMode == VuoMesh_LineStrip)
138  else
139  return VuoMesh_Points;
140 }
141 
143 
147 char * VuoMesh_getString(const VuoMesh value);
148 void VuoMesh_retain(const VuoMesh v);
149 void VuoMesh_release(const VuoMesh v);
151