HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_TrimCells.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GU library (C++)
7  *
8  * COMMENTS: Tracks state of cells of trimmed patches .
9  *
10  */
11 
12 #ifndef __GU_TrimCells_h__
13 #define __GU_TrimCells_h__
14 
15 #include "GU_API.h"
16 
18 {
19 public:
20  GU_TrimCells(int udiv, int vdiv);
21  ~GU_TrimCells();
22 
23  int64 getMemoryUsage(bool inclusive) const;
24 
25  void addCurve(int i, int j)
26  { if (i >= 0 && i < myVDiv && j >= 0 && j < myUDiv)
27  myCellStates[i*myUDiv + j] = 1; }
28  char &operator()(int i, int j)
29  { return myCellStates[i*myUDiv + j]; }
30  char operator()(int i, int j) const
31  { return myCellStates[i*myUDiv + j]; }
32  char *operator()(int i) const
33  { return &myCellStates[i*myUDiv]; }
34 
35  // Returns runlength of cell at i,j.
36  int runLength(int i, int j) const;
37 
38  // Do 4 directional fill from i/j replacing with state state.
39  // 0 elements are considered empty.
40  void fill(int i, int j, char state);
41 
42 private:
43  int myUDiv, myVDiv;
44  char *myCellStates;
45 };
46 
47 #endif
char operator()(int i, int j) const
Definition: GU_TrimCells.h:30
char * operator()(int i) const
Definition: GU_TrimCells.h:32
void addCurve(int i, int j)
Definition: GU_TrimCells.h:25
FMT_NOINLINE FMT_CONSTEXPR auto fill(OutputIt it, size_t n, const fill_t< Char > &fill) -> OutputIt
Definition: format.h:1262
char & operator()(int i, int j)
Definition: GU_TrimCells.h:28
long long int64
Definition: SYS_Types.h:116
#define GU_API
Definition: GU_API.h:14
GLint j
Definition: glad.h:2733