HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GD_TrimQuadTree.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: Geometry Library (C++)
7  *
8  * COMMENTS:
9  * This class handles trimming loops. Each loop is a series of
10  * bezier segments which in totality is closed. Loops themselves
11  * are embedded in a linked list of loops.
12  *
13  */
14 
15 #ifndef __GD_TrimQuadTree_h__
16 #define __GD_TrimQuadTree_h__
17 
18 #include "GD_API.h"
19 #include <UT/UT_Defines.h>
20 #include <UT/UT_VectorTypes.h>
21 #include <UT/UT_BoundingRect.h>
22 
23 class GD_TrimLoop;
24 class GD_TrimQuadBaseNode;
25 
27 {
28 public:
29  GD_TrimQuadTree(const GD_TrimLoop &loops, const UT_BoundingRect &rect);
30  ~GD_TrimQuadTree();
31 
32  // When querying whether a region is entirely inside or outside, the
33  // following enum is used. Out means that the region is entirely
34  // trimmed out. In means that there are no trim curves on the interior
35  // of the region. Mix means that there are trim curves which pass
36  // through the region.
37  enum GD_TrimState { GD_TRIM_OUT, GD_TRIM_IN, GD_TRIM_MIX };
38 
39  // Not const as updates cache:
40  int isTrimmedIn(const UT_Vector2 &pt);
41  int isTrimmedIn(float u, float v);
42 
43  // This also updates the cache. It's a quick check to see if a whole
44  // region is trimmed out. It's only reasonably accurate though.
45  GD_TrimState isTrimmedOut(const UT_BoundingRect &rect);
46  GD_TrimState isTrimmedOut(float u0, float u1, float v0, float v1);
47 
48 private:
49  float myUStart, myULength, myUConversion;
50  float myVStart, myVLength, myVConversion;
51  GD_TrimQuadBaseNode *myNodes;
52  GD_TrimQuadBaseNode *myCachedNode;
53  GD_TrimLoop *myLoops;
54 };
55 
56 #endif
const GLdouble * v
Definition: glcorearb.h:836
GLfloat v0
Definition: glcorearb.h:815
#define GD_API
Definition: GD_API.h:10
GLfloat GLfloat v1
Definition: glcorearb.h:816