HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GSTY_SubjectPrimGroup.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: GSTY_SubjectPrimGroup.h ( GSTY Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GSTY_SubjectPrimGroup__
12 #define __GSTY_SubjectPrimGroup__
13 
14 #include "GSTY_API.h"
15 #include "GSTY_SubjectPrim.h"
16 #include <GOP/GOP_Manager.h>
17 #include <STY/STY_SubjectGroup.h>
19 #include <UT/UT_StringHolder.h>
20 #include <UT/UT_Array.h>
21 #include <UT/UT_Lock.h>
22 
23 class GA_ElementGroup;
24 class GEO_Primitive;
25 class GEO_Detail;
26 
27 /// Represents a group of primitives that can be affected by style sheets.
29 {
30 public:
32  const GEO_Detail &gdp,
34  int numeric_prim_group_offset = 0,
35  int numeric_point_group_offset = 0,
36  bool apply_detail_style_attribute = true,
37  bool apply_prim_style_attribute = true);
39  const GEO_Detail &gdp,
40  int start_idx, int end_idx,
41  int numeric_prim_group_offset = 0,
42  int numeric_point_group_offset = 0,
43  bool apply_detail_style_attribute = true,
44  bool apply_prim_style_attribute = true);
45  ~GSTY_SubjectPrimGroup() override;
46 
47  int getNumSubjects() const override;
48  const STY_Subject &getSubject(int idx) const override;
49 
50  const GEO_Primitive &getPrimitive(int idx) const;
51  const GA_ElementGroup *getGroup(const char *group_str,
52  GA_GroupType group_type);
53  const STY_StyleSheetHandle &getStyleSheet(const UT_StringHolder &ss_str);
54 
55  const GEO_Detail &getDetail() const
56  {
57  return myGdp;
58  }
59 
60 private:
61  typedef UT_ConcurrentHashMap<unsigned,
62  const GA_ElementGroup *> gsty_GroupMap;
63  typedef UT_ConcurrentHashMap<unsigned,
64  STY_StyleSheetHandle> gsty_StyleSheetMap;
65 
66  UT_Array<GSTY_SubjectPrim> mySubjects;
67  GOP_Manager myGopManager;
68  const GEO_Detail &myGdp;
69  gsty_GroupMap myParsedGroups;
70  gsty_StyleSheetMap myStyleSheets;
71  UT_Lock myLock;
72  int myNumericPrimGroupOffset;
73  int myNumericPointGroupOffset;
74 };
75 
76 #endif
77 
#define GSTY_API
Definition: GSTY_API.h:10
Represents a group of primitives that can be affected by style sheets.
virtual int getNumSubjects() const =0
Returns the number of subjects in this group.
virtual const STY_Subject & getSubject(int idx) const =0
Returns a subject by index.
#define UT_ConcurrentHashMap
const GEO_Detail & getDetail() const
GA_GroupType
An ordinal enum for the different types of groups in GA.
Definition: GA_Types.h:161