HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GSTY_SubjectPrim.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_SubjectPrim.h ( GSTY Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GSTY_SubjectPrim__
12 #define __GSTY_SubjectPrim__
13 
14 #include "GSTY_API.h"
15 #include <STY/STY_SubjectNamed.h>
16 #include <GA/GA_Handle.h>
17 
19 class GEO_Primitive;
20 class GEO_Detail;
21 
22 /// Represents a primitive whose material properties are being overiden.
24 {
25 public:
26  GSTY_SubjectPrim(const GEO_Primitive *prim,
27  int numeric_prim_group_offset,
28  int numeric_point_group_offset,
29  GSTY_SubjectPrimGroup *subject_group,
30  const GA_ROHandleS &detail_attrib,
31  const GA_ROHandleS &prim_attrib);
32 
33  // Note: this constructor will perform attribute lookups, which can be
34  // expensive.
35  GSTY_SubjectPrim(const GEO_Primitive *prim,
36  GSTY_SubjectPrimGroup *subject_group);
37 
38  /// Base class overrides.
40  matchesStyleTarget(const STY_TargetHandle &target) const override;
43  const UT_StringHolder &data_name) const override;
45  getPreFilterStyleSheet() const override;
47  getPostFilterStyleSheet() const override;
49  getSourceLocation() const override;
50 
51  const GEO_Primitive &getPrimitive() const;
52 
53  /// Returns true if the provided detail has any attributes that may
54  /// contribute style information to this subject.
55  static bool hasStyleAttrib(const GEO_Detail &gdp);
56 
57 private:
58  /// Base class overrides.
59  UT_StringHolder getSubjectName() const override;
60  int64 getSubjectID() const override;
61 
62  /// Reference to the primitve represented by this styling subject.
63  const GEO_Primitive *myPrimitive;
64  GSTY_SubjectPrimGroup *mySubjectGroup;
65  GA_ROHandleS myDetailAttrib;
66  GA_ROHandleS myPrimAttrib;
67  int myNumericPrimGroupOffset;
68  int myNumericPointGroupOffset;
69 };
70 
71 #endif
72 
#define GSTY_API
Definition: GSTY_API.h:10
virtual STY_TargetMatchStatus matchesStyleTarget(const STY_TargetHandle &target) const =0
Returns the information wheter the subject matches the given target.
virtual UT_StringHolder getSubjectName() const =0
Contains information about the style subject match to the style target.
Represents a group of primitives that can be affected by style sheets.
virtual STY_StyleSheetHandle getPreFilterStyleSheet() const
virtual STY_BindingDataSourceHandle getOverrideBindingDataSource(const UT_StringHolder &data_name) const
virtual UT_StringHolder getSourceLocation() const
long long int64
Definition: SYS_Types.h:116
GLenum target
Definition: glcorearb.h:1667
virtual STY_StyleSheetHandle getPostFilterStyleSheet() const
Represents a primitive whose material properties are being overiden.
Helper class for subjects that have names and IDs.
virtual int64 getSubjectID() const =0