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_BoundingRect.h>
20 #include <UT/UT_VectorTypes.h>
21 
22 class GD_TrimLoop;
23 class GD_TrimQuadBaseNode;
24 
26 {
27 public:
28  GD_TrimQuadTree(const GD_TrimLoop &loops, const UT_BoundingRect &rect);
29  ~GD_TrimQuadTree();
30 
31  // When querying whether a region is entirely inside or outside, the
32  // following enum is used. Out means that the region is entirely
33  // trimmed out. In means that there are no trim curves on the interior
34  // of the region. Mix means that there are trim curves which pass
35  // through the region.
36  enum GD_TrimState { GD_TRIM_OUT, GD_TRIM_IN, GD_TRIM_MIX };
37 
38  // Not const as updates cache:
39  int isTrimmedIn(const UT_Vector2 &pt);
40  int isTrimmedIn(float u, float v);
41 
42  // This also updates the cache. It's a quick check to see if a whole
43  // region is trimmed out. It's only reasonably accurate though.
44  GD_TrimState isTrimmedOut(const UT_BoundingRect &rect);
45  GD_TrimState isTrimmedOut(float u0, float u1, float v0, float v1);
46 
47 private:
48  float myUStart, myULength, myUConversion;
49  float myVStart, myVLength, myVConversion;
50  GD_TrimQuadBaseNode *myNodes;
51  GD_TrimQuadBaseNode *myCachedNode;
52  GD_TrimLoop *myLoops;
53 };
54 
55 #endif
myNodes
Definition: UT_RTreeImpl.h:708
const GLdouble * v
Definition: glcorearb.h:837
GLdouble u1
Definition: glad.h:2676
GLfloat v0
Definition: glcorearb.h:816
#define GD_API
Definition: GD_API.h:10
GLfloat GLfloat v1
Definition: glcorearb.h:817