HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
OP_StyleManager.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: OP_StyleManager.h ( OP Library, C++)
7
*
8
* COMMENTS:
9
*/
10
11
#ifndef __OP_StyleManager__
12
#define __OP_StyleManager__
13
14
#include "
OP_API.h
"
15
#include "
OP_Output.h
"
16
#include "
OP_Value.h
"
17
#include <
DEP/DEP_MicroNode.h
>
18
#include <
UT/UT_StringMap.h
>
19
#include <
UT/UT_StringArray.h
>
20
#include <
UT/UT_UniquePtr.h
>
21
#include <iosfwd>
22
23
class
UT_IStream
;
24
class
OP_Director
;
25
26
#define INVALID_STYLE_VERSION (-1)
27
28
class
OP_API
OP_StyleManager
29
{
30
public
:
31
OP_StyleManager
(
OP_Director
*dir);
32
~
OP_StyleManager
();
33
34
/// For saving to and loading from a hip file.
35
bool
save(std::ostream &os,
int
binary
)
const
;
36
bool
load(
UT_IStream
&is);
37
38
/// Creation and deletion of styles.
39
bool
addStyle(
const
UT_StringHolder
&
name
,
40
const
UT_StringHolder
&description,
41
const
UT_StringHolder
&style);
42
bool
renameStyle(
const
UT_StringHolder
&old_name,
43
const
UT_StringHolder
&new_name);
44
bool
reorderStyles(
const
UT_StringArray
&names);
45
void
removeStyle(
const
UT_StringRef
&name);
46
void
removeAll();
47
48
/// Fetching information about existing styles.
49
bool
hasStyle(
const
UT_StringRef
&name)
const
;
50
const
UT_StringArray
&getStyleNames()
const
;
51
const
UT_StringHolder
&getStyleDescription(
52
const
UT_StringRef
&name)
const
;
53
const
UT_StringHolder
&getStyleSheet(
54
const
UT_StringRef
&name)
const
;
55
56
/// A simpe way to check for changes in a specific style without using
57
/// micro-nodes for dependency tracking. Good for maintaining a cache.
58
/// Version numbers will be unique for all style sheets within this
59
/// Houdini session.
60
int
getStyleVersion(
61
const
UT_StringRef
&name)
const
;
62
63
/// Get the micronode for tracking the set of available styles.
64
/// Propagates dirtiness when a style is added or removed.
65
DEP_MicroNode
&getMicroNode();
66
/// Get the micronode for tracking a articular style.
67
/// Propagates dirtiness when the style is changed or removed.
68
DEP_MicroNode
*getMicroNode(
const
UT_StringRef
&name);
69
70
/// Get a reference to the internal style sheet map.
71
const
UT_StringMap<UT_StringHolder>
&
72
getStyleSheetMap
()
const
73
{
return
myStyleSheets; }
74
75
/// Update references to moved SHOPs (called from
76
/// OP_Node::moveAndUpdateDependencies).
77
void
handleOpMoved(
const
OP_NodeList
&src_nodes,
78
const
OP_NodeList
&dest_nodes);
79
80
private
:
81
static
void
handleOpChanged(
OP_Node
*node,
82
OP_EventType
reason,
83
void
*
data
,
84
void
*cbdata);
85
void
handleOpNameChanged(
86
const
UT_StringArray
&old_names,
87
const
UT_StringArray
&new_names);
88
89
UT_StringArray
myStyleNames;
90
UT_StringMap<UT_StringHolder>
myStyleSheets;
91
UT_StringMap<UT_StringHolder>
myStyleDescriptions;
92
UT_StringMap<int>
myStyleVersions;
93
UT_StringMap<UT_UniquePtr<DEP_MicroNode>
> myStyleMicroNodes;
94
DEP_MicroNode
myStyleListMicroNode;
95
OP_Director
*myDirector;
96
};
97
98
#endif
UT_StringMap< UT_StringHolder >
OP_StyleManager
Definition:
OP_StyleManager.h:28
OP_StyleManager::getStyleSheetMap
const UT_StringMap< UT_StringHolder > & getStyleSheetMap() const
Get a reference to the internal style sheet map.
Definition:
OP_StyleManager.h:72
UT_IStream
Definition:
UT_IStream.h:56
binary
const GLuint GLenum const void * binary
Definition:
glcorearb.h:1924
UT_StringArray.h
UT_StringRef
Definition:
UT_StringHolder.h:188
OP_API.h
UT_Array< OP_Node * >
UT_StringHolder
Definition:
UT_StringHolder.h:999
UT_StringArray
Definition:
UT_StringArray.h:24
OP_Node
Definition:
OP_Node.h:503
DEP_MicroNode.h
name
GLuint const GLchar * name
Definition:
glcorearb.h:786
OP_Director
Create an evaluation context scope with a new node.
Definition:
OP_Director.h:67
UT_UniquePtr.h
OP_API
#define OP_API
Definition:
OP_API.h:10
OP_EventType
OP_EventType
Definition:
OP_Value.h:22
OP_Value.h
DEP_MicroNode
Definition:
DEP_MicroNode.h:60
OP_Output.h
UT_StringMap.h
data
Definition:
format.h:895
OP
OP_StyleManager.h
Generated on Sat Nov 23 2024 02:46:14 for HDK by
1.8.6