HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
STY_Subject.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_Subject.h ( STY Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __STY_Subject__
12 #define __STY_Subject__
13 
14 #include "STY_API.h"
15 #include "STY_Types.h"
16 #include "STY_BindingDataSource.h"
17 #include <UT/UT_IntrusivePtr.h>
18 
20 
21 /// Describes the entity subjected to stylilng, ie, entity whose properties can
22 /// be overriden by style sheets (eg, a specific primitive in the whole scene,
23 /// whose material diffuse color is being overriden from blue to red).
24 /// Subjects matching a given target may be asked to provide pre binding
25 /// data associated with the target.
26 /// Also, subject may optionally provide additional style sheet, which contains
27 /// overrides that are intended to itself (self-targeted entries) or that are
28 /// intended for subject's children (non self-target entries), if subjects
29 /// are structured hierarchically (eg, in the case of packed primitives).
31  public UT_IntrusiveRefCounter<STY_Subject>
32 {
33 public:
34  virtual ~STY_Subject()
35  { }
36 
37  /// Returns the information wheter the subject matches the given target.
38  virtual STY_TargetMatchStatus
39  matchesStyleTarget(const STY_TargetHandle &target) const = 0;
40 
41  /// Returns a source object that can provide data for the given data name.
42  /// Eg, style subject representing a primitive can provide primitive
43  /// attribute data.
45  getOverrideBindingDataSource(
46  const UT_StringHolder &data_name) const;
47 
48  /// Returns the style sheet that should be applied
49  /// to this subject. This style sheet is applied _before_ this subject
50  /// is used to filter out non-matching styles. This subject is the top
51  /// level target for these styles.
52  /// Returns an empty string, if no style sheet is provided.
53  virtual STY_StyleSheetHandle
54  getPreFilterStyleSheet() const;
55 
56  /// Returns the style sheet that should be applied
57  /// to this subject and its children. This style sheet is applied _after_
58  /// this subject is used to filter out non-matching styles. The children
59  /// of this subject are the top level targets for these styles.
60  /// Returns an empty string, if no style sheet is provided.
61  virtual STY_StyleSheetHandle
62  getPostFilterStyleSheet() const;
63 
64  /// Returns the location where the above subject-specific style sheet
65  /// comes from. For example the name of the object, prim number, etc.
66  /// Returns a default value of "Unknown Subject Source".
67  virtual UT_StringHolder
68  getSourceLocation() const;
69 
70 protected:
71  /// Helper for handling path requirement.
73  matchesPathHelper(const UT_StringRef &path,
74  const STY_TargetHandle &target,
75  char separator) const;
76 };
77 
78 #endif
79 
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
Contains information about the style subject match to the style target.
#define STY_API
Definition: STY_API.h:10
A reference counter base class for use with UT_IntrusivePtr.
GLenum target
Definition: glcorearb.h:1667
virtual ~STY_Subject()
Definition: STY_Subject.h:34