QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
opennurbs_rendering.h
Go to the documentation of this file.
1/* $NoKeywords: $ */
2/*
3//
4// Copyright (c) 1993-2007 Robert McNeel & Associates. All rights reserved.
5// Rhinoceros is a registered trademark of Robert McNeel & Assoicates.
6//
7// THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
8// ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
9// MERCHANTABILITY ARE HEREBY DISCLAIMED.
10//
11// For complete openNURBS copyright information see <http://www.opennurbs.org>.
12//
14*/
15
16#if !defined(OPENNURBS_RENDERING_INC_)
17#define OPENNURBS_RENDERING_INC_
18
19
21{
22public:
24 void Default();
25 int Compare( const ON_RenderingAttributes& other ) const;
26 bool Write( ON_BinaryArchive& archive ) const;
27 bool Read( ON_BinaryArchive& archive );
28
29 bool IsValid( ON_TextLog* text_log ) const;
30
31
32 const ON_MaterialRef* MaterialRef( const ON_UUID& plugin_id ) const;
33
35};
36
38{
39public:
41 void Default();
42 int Compare( const ON_ObjectRenderingAttributes& other ) const;
43 bool Write( ON_BinaryArchive& archive ) const;
44 bool Read( ON_BinaryArchive& archive );
45
46 bool IsValid( ON_TextLog* text_log ) const;
47
48 /*
49 Description:
50 Update mapping channel transformations.
51 Parameters:
52 xform - [in]
53 Transformation applied to parent object.
54 Returns:
55 True is successful. False if there are mapping channels
56 and xform cannot be inverted.
57 */
58 bool Transform( const ON_Xform& xform );
59
60 /*
61 Parameters:
62 plugin_id - [in]
63 Returns:
64 A pointer to the plug-in's mapping reference, if there
65 is one. Otherwise NULL is returned.
66 */
67 const ON_MappingRef* MappingRef(
68 const ON_UUID& plugin_id
69 ) const;
70
71 /*
72 Parameters:
73 plugin_id - [in]
74 Returns:
75 If a mapping ref exists, it is returned. Otherwise
76 one is added.
77 */
78 ON_MappingRef* AddMappingRef(
79 const ON_UUID& plugin_id
80 );
81
82 /*
83 Parameters:
84 plugin_id - [in]
85 Returns:
86 If a mapping ref exists, it is returned. Otherwise
87 one is added.
88 */
89 bool DeleteMappingRef(
90 const ON_UUID& plugin_id
91 );
92
93
94 /*
95 Parameters:
96 plugin_id - [in]
97 mapping_channel_id - [in]
98 mapping_id - [in]
99 ON_TextureMapping id
100 Returns:
101 A pointer to the plug-in's mapping channel, if there
102 is one. Otherwise NULL is returned.
103 */
104 const ON_MappingChannel* MappingChannel(
105 const ON_UUID& plugin_id,
106 int mapping_channel_id
107 ) const;
108
109 const ON_MappingChannel* MappingChannel(
110 const ON_UUID& plugin_id,
111 const ON_UUID& mapping_id
112 ) const;
113
114
115 /*
116 Parameters:
117 plugin_id - [in]
118 mapping_channel_id - [in]
119 mapping_id - [in]
120 ON_TextureMapping id
121 Returns:
122 True if the mapping channel was added or a pefect
123 match already existed. False if a mapping channel
124 with a different mapping_id already exists for this
125 plug-in and channel.
126 */
127 bool AddMappingChannel(
128 const ON_UUID& plugin_id,
129 int mapping_channel_id,
130 const ON_UUID& mapping_id
131 );
132
133 /*
134 Parameters:
135 plugin_id - [in]
136 mapping_channel_id - [in]
137 mapping_id - [in]
138 ON_TextureMapping id
139 Returns:
140 True if a matching mapping channel was deleted.
141 */
142 bool DeleteMappingChannel(
143 const ON_UUID& plugin_id,
144 int mapping_channel_id
145 );
146
147 bool DeleteMappingChannel(
148 const ON_UUID& plugin_id,
149 const ON_UUID& mapping_id
150 );
151
152 /*
153 Parameters:
154 plugin_id - [in]
155 old_mapping_channel_id - [in]
156 new_mapping_channel_id - [in]
157 Returns:
158 True if a matching mapping channel was found and changed.
159 */
160 bool ChangeMappingChannel(
161 const ON_UUID& plugin_id,
162 int old_mapping_channel_id,
163 int new_mapping_channel_id
164 );
165
166 // Use AddMappingRef() or AddMappingChannel() if you
167 // want to add an element to this array.
168 //
169 // Every mapping ref in this array must have
170 // a distinct value of ON_MappingRef.m_plugin_id.
172
173 bool m_bCastsShadows; // default is true
174 bool m_bReceivesShadows; // default is true
177};
178
179#if defined(ON_DLL_TEMPLATE)
180// This stuff is here because of a limitation in the way Microsoft
181// handles templates and DLLs. See Microsoft's knowledge base
182// article ID Q168958 for details.
183#pragma warning( push )
184#pragma warning( disable : 4231 )
185ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_RenderingAttributes>;
186ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_ObjectRenderingAttributes>;
187#pragma warning( pop )
188#endif
189
190
191#endif
192
@ Transform
Definition RSMetaType.h:67
Definition opennurbs_archive.h:152
Definition opennurbs_array.h:760
Definition opennurbs_mapchan.h:34
Definition opennurbs_mapchan.h:91
Definition opennurbs_mapchan.h:177
Definition opennurbs_rendering.h:38
bool m_bReserved1
Definition opennurbs_rendering.h:175
bool m_bReceivesShadows
Definition opennurbs_rendering.h:174
ON_ClassArray< ON_MappingRef > m_mappings
Definition opennurbs_rendering.h:171
bool m_bCastsShadows
Definition opennurbs_rendering.h:173
bool m_bReserved2
Definition opennurbs_rendering.h:176
Definition opennurbs_rendering.h:21
ON_ClassArray< ON_MaterialRef > m_materials
Definition opennurbs_rendering.h:34
Definition opennurbs_textlog.h:20
Definition opennurbs_uuid.h:31
Definition opennurbs_xform.h:28
#define ON_CLASS
Definition opennurbs_defines.h:91