HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
STY_StylerGroup.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: STY_StylerGroup.h ( STY Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __STY_StylerGroup__
12 #define __STY_StylerGroup__
13 
14 #include "STY_API.h"
15 #include "STY_Styler.h"
16 #include <UT/UT_StringArray.h>
17 #include <UT/UT_NonCopyable.h>
18 
19 class STY_SubjectGroup;
20 class STY_Results;
21 class STY_ResultsFilter;
22 
23 /// Represents a collection of STY_Stylers in a single class. This allows for
24 /// more efficient processing of multiple stylers.
26 {
27 public:
29  virtual ~STY_StylerGroup();
30 
31  /// Returns the number of stylers in this group.
32  int getNumStylers() const;
33 
34  /// Get a single styler corresponding to the subject with the same index
35  /// in the STY_SubjectGroup that was used to create this STY_StylerGroup.
36  const STY_Styler &getStyler(int idx) const;
37 
38  /// Returns style sheets for all stylers in this group.
39  void saveStyleSheets(UT_StringArray &stylesheets,
40  bool verbose=false,
41  bool path=false) const;
42 
43  /// Returns results for every styler in the group.
44  /// This method returns results from entries whose targets
45  /// have been previously fully matched by the subjects in the subject
46  /// hierarchy.
47  ///
48  /// @param filter An object that decides what kind of override
49  /// values the caller is interested in. It filters out results
50  /// that are not needed, and allows in the ones that the caller
51  /// wants to obtain. Eg, the caller may want only the results
52  /// in the 'materialParameters' category.
53  void getResults(UT_Array<STY_Results> &results,
54  const STY_ResultsFilter &filter) const;
55 
56  /// Adds stylers to this group from a parent styler and a subject group.
57  void append(const STY_Styler &parent_styler,
58  const STY_SubjectGroup &subjects);
59  /// Add a single styler that has been fully pruned. As much as possible
60  /// the group functions should be used, but sometimes we just care about
61  /// a single styler.
62  void append(const STY_Styler &styler);
63 
64 private:
65  // A block of stylers created by a call to append.
66  class STY_StylerGroupData :
67  public UT_IntrusiveRefCounter<STY_StylerGroupData>
68  {
69  public:
70  UT_Array<STY_Styler> myStylers;
72  exint myNumParentMatches;
73  exint myNumParentStyleSheets;
74  };
76 
77  // Our array of group data blocks.
79  exint myTotalNumStylers;
80 };
81 
82 #endif
83 
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
#define STY_API
Definition: STY_API.h:10
A reference counter base class for use with UT_IntrusivePtr.
int64 exint
Definition: SYS_Types.h:109
Wrapper around hboost::intrusive_ptr.
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1296