HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GOP_BreakpointGroupParser.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  * COMMENTS: This class contains a parser for the breakpoint groups.
7  * The doIt() method returns the number of breakpoints parsed,
8  * or -1 if an error has occured.
9  *
10  */
11 
12 #ifndef __GOP_BreakpointGroupParser_h__
13 #define __GOP_BreakpointGroupParser_h__
14 
15 #include "GOP_API.h"
16 #include "GOP_Parser.h"
17 #include <GA/GA_Types.h>
18 
19 class GEO_Detail;
20 class GA_BreakpointGroup;
21 class GOP_Manager;
22 class GA_Primitive;
23 class GEO_Primitive;
24 
26 {
27 public:
29  const UT_String &str,
30  bool strict = true, GA_Index prim_offset = GA_Index(0));
31 
32  // Build a string that contains the id's of the breakpoints in a breakpoint
33  // group. The offset is the amount to add to the ids of the primitives for
34  // each breakpoint in the group.
35  static void buildGroupToken(const GEO_Detail *gdp,
36  const GA_BreakpointGroup *bkptgrp,
37  UT_String &token, GA_Index offset = GA_Index(0));
38  // FIXME: Delete this once we split for 15.0.
39  static void buildGroupToken(const GEO_Detail *gdp,
40  const GA_BreakpointGroup *bkptgrp,
41  UT_String &token, int offset);
42 
43 private:
44 
45  virtual void init();
46  virtual void finish();
47  virtual bool dispatch(char c);
48 
49  // State Handlers
50  virtual void handleStart();
51  virtual void handleError();
52 
53  void handleCollectPrim();
54  void handleCollectSec();
55  void handleCollectName();
56  void handleCollectBreakpointU0();
57  void handleCollectBreakpointU1();
58  void handleCollectBreakpointV0();
59  void handleCollectBreakpointV1();
60 
61  // State Variables
62  bool myOpenBracket;
63  GA_Index myPrimIndex;
64  int mySecIndex;
65  int myU0;
66  int myU1;
67  int myV0;
68  int myV1;
69 
70  // Breakpoint Specific Methods
71  bool addCurveBreakpoint();
72  bool addSurfBreakpoint();
73  bool addSecBreakpoint();
74  bool addAllPrimBreakpoints(const GEO_Primitive *prim = 0);
75  bool addAllSecBreakpoints();
76  bool addAllSecBreakpoints(const GA_Primitive *prim);
77  bool addCurveBreakpointRange(int u0, int u1);
78  bool addSecBreakpointRange(int u0, int u1);
79  bool addSurfBreakpointRange(int u0, int u1, int v0, int v1);
80  bool addPrimGroup(const char *name);
81 
82  // Utility methods
83  const GEO_Primitive *getPrim();
84 
85  const GEO_Detail &myGdp;
86  GA_BreakpointGroup *myGroup;
87  GOP_Manager *myManager;
88  bool myStrictFlag;
89  GA_Index myPrimOffset;
90 };
91 
92 
93 #endif
virtual bool dispatch(char c)=0
virtual void finish()
#define GOP_API
Definition: GOP_API.h:10
virtual void handleError()=0
GLintptr offset
Definition: glcorearb.h:664
GLuint const GLchar * name
Definition: glcorearb.h:785
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:611
GLfloat v0
Definition: glcorearb.h:815
virtual void init()
GLfloat GLfloat v1
Definition: glcorearb.h:816
virtual void handleStart()=0