HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 GA_Breakpoint;
22 class GOP_Manager;
23 class GA_Primitive;
24 class GEO_Primitive;
25 
27 {
28 public:
30  const UT_String &str,
31  bool strict = true, GA_Index prim_offset = GA_Index(0));
32 
33  // Build a string that contains the id's of the breakpoints in a breakpoint
34  // group. The offset is the amount to add to the ids of the primitives for
35  // each breakpoint in the group.
36  static void buildGroupToken(const GEO_Detail *gdp,
37  const GA_BreakpointGroup *bkptgrp,
38  UT_String &token,
39  GA_Index offset = GA_Index(0));
40 
41  // Build a string representing a single breakpoint element. The offset is
42  // the amount to add to the ids of the primitive.
43  static void buildElementToken(const GEO_Detail *gdp,
44  const GA_Breakpoint &bkpt,
45  UT_String &token,
46  GA_Index offset = GA_Index(0));
47 
48 
49 private:
50 
51  virtual void init();
52  virtual void finish();
53  virtual bool dispatch(char c);
54 
55  // State Handlers
56  virtual void handleStart();
57  virtual void handleError();
58 
59  void handleCollectPrim();
60  void handleCollectSec();
61  void handleCollectName();
62  void handleCollectBreakpointU0();
63  void handleCollectBreakpointU1();
64  void handleCollectBreakpointV0();
65  void handleCollectBreakpointV1();
66 
67  // State Variables
68  bool myOpenBracket;
69  GA_Index myPrimIndex;
70  int mySecIndex;
71  int myU0;
72  int myU1;
73  int myV0;
74  int myV1;
75 
76  // Breakpoint Specific Methods
77  bool addCurveBreakpoint();
78  bool addSurfBreakpoint();
79  bool addSecBreakpoint();
80  bool addAllPrimBreakpoints(const GEO_Primitive *prim = 0);
81  bool addAllSecBreakpoints();
82  bool addAllSecBreakpoints(const GA_Primitive *prim);
83  bool addCurveBreakpointRange(int u0, int u1);
84  bool addSecBreakpointRange(int u0, int u1);
85  bool addSurfBreakpointRange(int u0, int u1, int v0, int v1);
86  bool addPrimGroup(const char *name);
87 
88  // Utility methods
89  const GEO_Primitive *getPrim();
90 
91  const GEO_Detail &myGdp;
92  GA_BreakpointGroup *myGroup;
93  GOP_Manager *myManager;
94  bool myStrictFlag;
95  GA_Index myPrimOffset;
96 };
97 
98 
99 #endif
GLuint const GLchar * name
Definition: glew.h:1814
GLuint GLdouble u1
Definition: glew.h:3446
virtual bool dispatch(char c)=0
virtual void finish()
#define GOP_API
Definition: GOP_API.h:10
virtual void handleError()=0
const GLfloat * c
Definition: glew.h:16296
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:631
virtual void init()
GLfloat v0
Definition: glew.h:1848
virtual void handleStart()=0
GLfloat GLfloat v1
Definition: glew.h:1852
GLintptr offset
Definition: glew.h:1682