RixSubdEval.h Source File

RixSubdEval.h
1 #ifndef RixSubdEval_h
2 #define RixSubdEval_h
3 /* $Revision: #1 $ $Date: 2015/04/23 $
4 # ------------------------------------------------------------------------------
5 #
6 # Copyright (c) 2010-2014 Pixar Animation Studios. All rights reserved.
7 #
8 # The information in this file (the "Software") is provided for the
9 # exclusive use of the software licensees of Pixar. Licensees have
10 # the right to incorporate the Software into other products for use
11 # by other authorized software licensees of Pixar, without fee.
12 # Except as expressly permitted herein, the Software may not be
13 # disclosed to third parties, copied or duplicated in any form, in
14 # whole or in part, without the prior written permission of
15 # Pixar Animation Studios.
16 #
17 # The copyright notices in the Software and this entire statement,
18 # including the above license grant, this restriction and the
19 # following disclaimer, must be included in all copies of the
20 # Software, in whole or in part, and all permitted derivative works of
21 # the Software, unless such copies or derivative works are solely
22 # in the form of machine-executable object code generated by a
23 # source language processor.
24 #
25 # PIXAR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
26 # ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
27 # SHALL PIXAR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
28 # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
29 # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
30 # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
31 # SOFTWARE.
32 #
33 # Pixar
34 # 1200 Park Ave
35 # Emeryville CA 94608
36 #
37 # ------------------------------------------------------------------------------
38 */
39 #include "RixInterfaces.h"
40 
41 class RixSubdivisionMesh;
42 class RixSubdivisionFace;
43 class RixSudivisionVertex;
44 
47 {
48 public:
51  virtual RixSubdivisionMesh *GetSubdivisionMesh(const char *handle) = 0;
52 
54  virtual RixSubdivisionMesh *CreateSubdivisionMesh(const RtToken mask,
55  int nfaces, const int *nverts, const int *verts, int ntags,
56  RtToken const *tags, int *ntagargs, int *intargs, float *floatargs,
57  char * const *stringargs, int nparms, RtToken const *tokens,
58  void **data) = 0;
59 
61  virtual void DestroySubdivisionMesh(RixSubdivisionMesh *mesh) = 0;
62 
63 protected:
66 };
67 
70 {
71 protected:
72  virtual ~RixSubdivisionVertex() { }
73 
74 public:
77  virtual int GetID() = 0;
78 
83  virtual int GetDataIndex() = 0;
84 
93  virtual bool GetValue(const RtToken name, int width, float *data) = 0;
94 
103  virtual bool GetValue(const RtToken name, int width, const RtToken space, float *data) = 0;
104 };
105 
108 protected:
110  virtual ~RixSubdivisionFace() { }
111 
112 public:
115  virtual int GetID() = 0;
116 
118  virtual int GetNumVertices() = 0;
119 
123  virtual RixSubdivisionVertex *GetVertex(int vertex) = 0;
124 
126  virtual void GetBound(RtBound bound) = 0;
127 
129  virtual void GetBound(const RtToken space, RtBound bound) = 0;
130 
142  virtual RixSubdivisionFace *GetNeighboringFace(int edge,
143  int *reverseEdge = 0) = 0;
144 
147  virtual void Subdivide() = 0;
148 
161  virtual RixSubdivisionFace *GetChildFace(int vertex,
162  int *childVertex = 0) = 0;
163 
166  virtual RixSubdivisionFace *GetParentFace() = 0;
167 
177  virtual bool GetVertexValue(int vertex, const RtToken name, int width,
178  float *data) = 0;
179 
189  virtual bool GetVertexValue(int vertex, const RtToken name,
190  int width, const RtToken space, float *data) = 0;
191 
192 
196  virtual bool GetStringValue(const RtToken name, std::string& data) = 0;
197 
202  virtual bool HasLimitSurface() = 0;
203 
214  virtual bool EvaluateAtLimit(float u, float v, const RtToken name,
215  int width, float *data) = 0;
216 
227  virtual bool EvaluateAtLimitMultiple(int nevals, float *u, float *v, const RtToken name,
228  int width, const RtToken space, float *data) = 0;
229 
230 
241  virtual void SetLimitEvaluationAccuracy(const RtToken space, float distance) = 0;
242 
259  virtual void Release() = 0;
260 };
261 
262 
265 protected:
267  virtual ~RixSubdivisionMesh() { }
268 
269 public:
271  virtual RtToken GetMask() = 0;
272 
275  virtual int GetNumFaces() = 0;
276 
278  virtual int GetNumCoarseFaces() = 0;
279 
281  virtual int GetNumVertices() = 0;
282 
285  virtual RixSubdivisionFace *GetFace(int id) = 0;
286 
289  virtual RixSubdivisionVertex *GetVertex(int id) = 0;
290 
292  virtual void Subdivide(int depth) = 0;
293 
297  virtual void GetPackedVertexDataIndices(int depth,
298  std::vector<int> &vertexcounts,
299  std::vector<int> &vertices) = 0;
300 
307  virtual bool GetPackedVertexValues(const RtToken name, int width,
308  const RtToken space,
309  std::vector<float> &data) = 0;
310 };
311 
312 
313 
314 #endif