CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TrRndRenderSettings.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23// GLES2 device local rendition render settings interface
24
25#ifndef ODTRRNDRENDERSETTINGS
26#define ODTRRNDRENDERSETTINGS
27
28#include "TD_PackPush.h"
29
31#include "../TrVisDefs.h"
32#include "../TrVisMetafileStream.h"
33
34// Forward declarations
35class OdGsFiler;
37
42
47
52
57{
58 public:
60};
61
63{
67};
68
73{
74 protected:
75 template <OdUInt32 nElems>
76 class BitSet {
77 protected:
79 public:
81 { clear(); }
82 void clear() { for (OdUInt32 n = 0; n < nElems; n++) m_flags[n] = 0; }
83 OdUInt8 *getPtr() { return m_flags; } const OdUInt8 *getPtr() const { return m_flags; }
84 void set(OdUInt32 nFlag) { SETBIT_1(m_flags[nFlag >> 3], 1 << (nFlag & 7)); }
85 void reset(OdUInt32 nFlag) { SETBIT_0(m_flags[nFlag >> 3], 1 << (nFlag & 7)); }
86 void set(OdUInt32 nFlag, bool bSet) { SETBIT(m_flags[nFlag >> 3], 1 << (nFlag & 7), bSet); }
87 bool get(OdUInt32 nFlag) const { return GETBIT(m_flags[nFlag >> 3], 1 << (nFlag & 7)); }
88 };
89 public:
91 {
93 // Elements rendering
94 kDraw3dFacets, // Draw shaded facets
95 kDraw2dFacets, // Draw non-shaded facets
96 kDrawRasterImages, // Draw raster images
97 kDraw3dFacetEdges, // Draw shaded facets wireframe
98 kDraw2dFacetEdges, // Draw non-shaded facets wireframe
99 kDrawIsolines, // Draw isolines
100 kDrawIntersections, // Draw intersection edges
101 kDrawSilhouettes, // Draw silhouettes
102 kDrawDefaultDisable, // Disable rendering of default elements
103 // Display quality settings
104 kDrawOrder, // Draw order enabled
105 kDrawBackground, // Draw backgrounds enabled
106 kDrawLineweights, // Draw lineweights
107 kDrawLighting, // Draw lighting
108 kDrawShadows, // Draw shadows
109 kDrawFog, // Draw fog effect
110 kDrawAntiAliasing, // Draw anti-aliasing effect
111 // Face quality settings
112 kDrawMaterials, // Draw materials
113 kDrawTextures, // Draw textures
114 kFillFacesColor, // Use color to fill faces
115 kFillFacesOpacity, // Override faces opacity
116 kFillFacesTexture, // Use texture to fill faces
117 kFaceNormals, // Use face normals instead vertex normals
118 kPerVertexLighting, // Use per-vertex lighting instead of per-pixel lighting
119 kGoochLighting, // Enable Gooch faces lighting instead of Phong
120 kFlatLighting, // Ignore light sources during Phong lighting calculation
121 kSpecularHighlighting, // Enable specular highlighting
122 kSpecularOverride, // Override specular highlighting for default materials
123 kShadingMaterial, // Use shading material instead of realistic material
124 // Edge quality settings
125 kOverrideEdgesColor, // Use edges color override
126 kOverrideEdgesWidth, // Use edges width override
127 kOverrideEdgesLinetype, // Use edges linetype override
128 kOverrideEdgesLinestyle, // Use edges linestyle override
129 kEdgesOpacity, // Use edges opacity
130 kEdgesCreaseFilter, // Use edges crease angle filtration
131 kEdgesCreaseFilter3d, // Use separate crease angle filtration for 3d object (active only if kEdgesCreaseFilter enabled)
132 kEdgesOverhang, // Use edges extension
133 kEdgesMultipass, // Draw edges multiple times
134 kEdgesJitter, // Use edges jitter effect
135 // FX-related
136 kDrawFX, // True in case if render settings represent effect rendering
137 kDisableColorOutput, // Disable color output for FX rendering
138 kDisableVSOverride, // Disable Visual Style overrides for FX rendering
139 kStencilTest, // Modifies stencil buffer processing behavior
140 kStencil3dTest, // Use separate stencil buffer setting for 3d objects (active only if kStencilTest enabled)
141 kDepthTest, // Modifies depth buffer processing behavior
142 kDepth3dTest, // Use separate depth buffer setting for 3d objects (active only if kDepthTest enabled)
143 kOverlappingDecision, // Setup to draw on top of exist geometry with same coordinates
144 kSkipImages, // Skip raster image textures application
145 // Last flag (do not modify manually)
147 kNumFlagRegs = (kNumFlags >> 3) + 1
148 };
149 // Settings for render modes
150#define OdTrRndRS_SetFor2dWireframe { kDraw3dFacets, kDraw2dFacets, kDrawRasterImages, kDraw2dFacetEdges, kDrawIsolines, \
151 kDrawOrder, kDrawBackground, kDrawLineweights, kDrawAntiAliasing, \
152 kNullFlag }
153#define OdTrRndRS_SetFor3dWireframe { kDraw2dFacets, kDraw2dFacetEdges, kDrawRasterImages, kDrawIsolines, \
154 kDrawBackground, kDrawLineweights, kDrawAntiAliasing, \
155 kNullFlag }
156#define OdTrRndRS_SetForHiddenLine { kDraw3dFacets, kDrawRasterImages, kDraw3dFacetEdges, kDraw2dFacetEdges, \
157 kDrawBackground, kDrawLineweights, kDrawAntiAliasing, \
158 kFillFacesColor, \
159 kNullFlag }
160#define OdTrRndRS_SetForFlatShaded { kDraw3dFacets, kDraw2dFacets, kDrawRasterImages, \
161 kDrawBackground, kDrawLineweights, kDrawLighting, kDrawShadows, kDrawFog, kDrawAntiAliasing, \
162 kDrawMaterials, kDrawTextures, kFaceNormals, kPerVertexLighting, kSpecularHighlighting, \
163 kNullFlag }
164#define OdTrRndRS_SetForGouraudShaded { kDraw3dFacets, kDraw2dFacets, kDrawRasterImages, \
165 kDrawBackground, kDrawLineweights, kDrawLighting, kDrawShadows, kDrawFog, kDrawAntiAliasing, \
166 kDrawMaterials, kDrawTextures, kPerVertexLighting, kSpecularHighlighting, \
167 kNullFlag }
168#define OdTrRndRS_SetForFlatShadedWithWireframe { kDraw3dFacets, kDraw2dFacets, kDrawRasterImages, kDraw3dFacetEdges, kDraw2dFacetEdges, \
169 kDrawBackground, kDrawLineweights, kDrawLighting, kDrawShadows, kDrawFog, kDrawAntiAliasing, \
170 kDrawMaterials, kDrawTextures, kFaceNormals, kPerVertexLighting, kSpecularHighlighting, \
171 kNullFlag }
172#define OdTrRndRS_SetForGouraudShadedWithWireframe { kDraw3dFacets, kDraw2dFacets, kDrawRasterImages, kDraw3dFacetEdges, kDraw2dFacetEdges, \
173 kDrawBackground, kDrawLineweights, kDrawLighting, kDrawShadows, kDrawFog, kDrawAntiAliasing, \
174 kDrawMaterials, kDrawTextures, kPerVertexLighting, kSpecularHighlighting, \
175 kNullFlag }
176#define OdTrRndRS_FX { kDrawFX, kNullFlag }
178 {
184 };
185 struct Color
186 {
189 Color(ColorType colorType = kColorBackground, ODCOLORREF colorVal = ODRGBA(0, 0, 0, 255))
190 : m_colorType(colorType), m_colorVal(colorVal) { }
191 };
192 // Draw properties
194 {
195 // Viewport (global)
196 kPropBackgroundColor = 0, // Background viewport color
197 kPropForegroundColor, // Foreground viewport color
198 // Faces
199 kPropFacesFillColor, // Faces fill color override
200 // Edges
201 kPropEdgesColor, // Edges color override
202 // FX-related
203 // . . .
204 // Number of color properties
206 };
208 {
209 // Faces
210 kPropFacesSpecularPower = 0, // Material specular power coefficient override
211 kPropFacesOpacity, // Faces opacity override
212 // Edges
213 kPropEdgesCreaseAngle, // Edge crease filtration angle
215 // FX-related
216 // . . .
217 // Number of floating point properties
219 };
221 {
222 // Viewport (global)
223 kPropDrawFilter = 0, // Inclusive metafiles rendering filter
224 // Faces
225 // . . .
226 // Edges
227 kPropEdgesWidth, // Edges lineweight override (in pixels)
228 kPropEdgesLinetype, // Edges linetype override (using OdPs::LineType enum)
229 kPropEdgesLinestyle, // Edges linestyle override (using make_edgesStyle() form)
230 kPropEdgesCreaseFilter, // Edges crease filter (using CreaseFlags enum)
231 kPropEdgesCreaseFilter3d, // Separate edges crease filter for 3d objects (using CreaseFlags enum)
232 kPropEdgesOverhang, // Edges extension length (in pixels)
233 kPropEdgesRepetition, // Number of repetitions per edges rendering (applicable for jitter effect only)
234 kPropEdgesJitterAmount, // Jitter effect amount (in pixels)
235 // FX-related
236 kPropStencilFlags, // Stencil buffer flags (using StencilFlags enum)
237 kPropStencil3dFlags, // Separate stencil buffer flags for 3d objects (using StencilFlags enum)
238 kPropDepthFlags, // Depth buffer flags (using DepthFlags enum)
239 kPropDepth3dFlags, // Separate depth buffer flags for 3d objects (using DepthFlags enum)
240 // Number of integer properties
242 };
243 // Type of multi-pass effect
245 {
246 kMultiPassByObject = 0, // Multi-pass rendering of separate object
247 kMultiPassByScene, // Multi-pass rendering of entire scene
248 kMultiPassInputFX, // Input effect for current rendering stage
249 kMultiPassOutputFX, // Output effect for current rendering stage
250 kMultiPassForSections, // Multi-pass rendering for hardware sections
251
252 // !!! To add multi-pass support for additional geometry types modify geomTypeMultiPass() method implementation also.
253 //kMultiPassFor3dFacets, // Multi-pass rendering of shaded facets // kDraw3dFacets
254 //kMultiPassFor2dFacets, // Multi-pass rendering of non-shaded facets // kDraw2dFacets
255 //kMultiPassForRasterImages, // Multi-pass rendering of raster images // kDrawRasterImages
256 //kMultiPassFor3dFacetEdges, // Multi-pass rendering of shaded facets wireframe // kDraw2dFacetEdges
257 //kMultiPassFor2dFacetEdges, // Multi-pass rendering of non-shaded facets wireframe // kDraw2dFacetEdges
258 //kMultiPassForIsolines, // Multi-pass rendering of isolines // kDrawIsolines
259 kMultiPassForIntersections, // Multi-pass rendering of intersection edges // kDrawIntersections
260 //kMultiPassForSilhouettes, // Multi-pass rendering of silhouettes // kDrawSilhouettes
261
263 };
264 // kPropStencilFlags property settings
266 {
267 kStencilWriteBit1 = (1 << 0), kStencilWriteBit2 = (1 << 1), kStencilWriteBit3 = (1 << 2), kStencilWriteBit4 = (1 << 3),
269 kStencilTestBit1 = (1 << 4), kStencilTestBit2 = (1 << 5), kStencilTestBit3 = (1 << 6), kStencilTestBit4 = (1 << 7),
271 kStencilReadBit1 = (1 << 8), kStencilReadBit2 = (1 << 9), kStencilReadBit3 = (1 << 10), kStencilReadBit4 = (1 << 11),
274 };
275 // kPropDepthFlags property settings
277 {
280 kDepthReadOnly = (1 << 4)
281 };
282 // kPropEdgesCreaseFilter property settings
284 {
285 // Most reasonable states:
286 kCreaseFrontEdges = -2, // Completely front edge
287 kCreaseFrontCorners = -1, // Corner edge at front
288 kCreaseBreakEdges = 0, // Break edge (partially at front, partially at back)
289 kCreaseBackCorners = 1, // Corner edge at back
290 kCreaseBackEdges = 2 // Completely back edge
291 };
293 {
294 kCreaseDrawAllEdges = 0x32, // -2, 2 - Draw everything (default)
295 kCreaseDrawFrontEdgesOnly = 0x35, // -2,-1 - Draw front edges only
296 kCreaseDrawFrontEdgesWithCorners = 0x30, // -2, 0 - Draw front edges and front corner edges
297 kCreaseDrawBreakEdgesWithCorners = 0x29, // -1, 1 - Draw break edges and corner edges
298 kCreaseDrawBreakEdgesOnly = 0x00, // 0, 0 - Draw break edges only
299 kCreaseDrawBackEdgesWithCorners = 0x02, // 0, 2 - Draw back edges and back corner edges
300 kCreaseDrawBackEdgesOnly = 0x0A // 1, 2 - Draw back edges only
301 };
303 { return (flags < kCreaseBreakEdges) ? OdUInt32(-flags | 4) : OdUInt32(flags); }
305 { return (CreaseFlags)((GETBIT(flags, 4)) ? -OdInt32(flags & 3) : OdInt32(flags & 3)); }
306 inline static OdUInt32 make_creaseFilter(CreaseFlags frontLimit, CreaseFlags backLimit)
307 { return (creaseFlagEncode(frontLimit) << 3) | creaseFlagEncode(backLimit); }
308 inline static OdUInt32 make_creaseFilter(CreaseFilterDefault defFilter) { return (OdUInt32)defFilter; }
309 inline static CreaseFlags get_creaseFilterFront(OdUInt32 creaseFilter) { return creaseFlagDecode((creaseFilter >> 3) & 7); }
310 inline static CreaseFlags get_creaseFilterBack(OdUInt32 creaseFilter) { return creaseFlagDecode(creaseFilter & 7); }
311 // kPropEdgesLinestyle property setting
313 { return OdUInt32(lesStyle) | (OdUInt32(ljsStyle) << 8); }
314 inline static OdPs::LineEndStyle get_lineEndStyle(OdUInt32 lineStyle) { return (OdPs::LineEndStyle)(lineStyle & 0xFF); }
315 inline static OdPs::LineJoinStyle get_lineJoinStyle(OdUInt32 lineStyle) { return (OdPs::LineJoinStyle)((lineStyle >> 8) & 0xFF); }
316 // UI properties grouping
318 {
325 };
327 {
330 {
339 UIDefVal(bool bDrawFlag) { m_colorProp.reset(); m_drawFlag = bDrawFlag; }
340 UIDefVal(ColorType colorType, ODCOLORREF colorVal = ODRGBA(0, 0, 0, 255)) { m_colorProp.m_colorType = colorType; m_colorProp.m_colorVal = colorVal; }
341 UIDefVal(float floatProp) { m_colorProp.reset(); m_floatProp = floatProp; }
342 UIDefVal(OdInt32 intProp) { m_colorProp.reset(); m_intProp = intProp; }
343 UIDefVal(OdUInt32 uintProp) { m_colorProp.reset(); m_uintProp = uintProp; }
344 };
346 {
347 float m_limFlt;
350 UIPropRange() { m_limFlt = 0.0f; }
351 };
353 {
357 UIPropRanges(float fltMin, float fltMax) { m_min.m_limFlt = fltMin; m_max.m_limFlt = fltMax; }
358 UIPropRanges(OdInt32 intMin, OdInt32 intMax) { m_min.m_limInt = intMin; m_max.m_limInt = intMax; }
359 UIPropRanges(OdUInt32 uintMin, OdUInt32 uintMax) { m_min.m_limUInt = uintMin; m_max.m_limUInt = uintMax; }
360 };
362 {
370 };
371 protected:
373 {
374 kRenderModeOverride = (1 << 0), // If set to true render mode settings will be got directly from viewport.
375 kSuppressReactor = (1 << 1), // If set then reactor willn't be called by default for this render settings object.
376 kRSFlagsCopyMask = kRenderModeOverride // Flags which can be copied between render settings.
377 };
378 protected:
379 OdUInt16 m_rsFlags; // Render settings specific flags
380 OdUInt16 m_rsPassId; // User-defined pass Id
381 OdGsView::RenderMode m_renderMode; // Used to set basic parameters.
382 BitSet<kNumFlagRegs> m_nDrawFlags; // Set of bit (draw) flags
383 Color m_colorProps[kNumColorProps]; // Set of color data properties
384 float m_floatProps[kNumFloatProps]; // Set of floating point data properties
385 OdInt32 m_intProps[kNumIntegerProps]; // Set of integer properties
386 // Pointer to next pass for multipass render settings
388 // Differential transition from previous pass
390 // Attached render setting reactors
392 public:
395 , m_rsPassId(0)
396 , m_renderMode(initialRenderMode)
397 , m_nDrawFlags()
398 {
399 setReactorDefault(rsDefault);
400 setForRenderMode(initialRenderMode, kRSIgnoreReactor);
403 }
405 {
406 *this = rs;
407 }
409 {
410 }
411
413
414 // Control rendering settings overriding
416 {
418 }
420 {
422 react(rsReact);
423 }
424
425 // Basic rendering mode
427 {
428 return m_renderMode;
429 }
431 {
432 m_renderMode = rMode;
433 react(rsReact);
434 }
435
436 // User-defined passId
438 {
439 return m_rsPassId;
440 }
442 {
443 m_rsPassId = nPassId;
444 react(rsReact);
445 }
447 OdUInt16 passMask = 0xFFFF, bool bSearchNested = true) const;
448
449 // Draw flags accessors
450 bool drawFlag(OdUInt32 nFlag) const
451 {
452 return m_nDrawFlags.get(nFlag);
453 }
455 {
456 m_nDrawFlags.set(nFlag);
457 react(rsReact);
458 }
460 {
461 m_nDrawFlags.reset(nFlag);
462 react(rsReact);
463 }
465 {
466 m_nDrawFlags.set(nFlag, bSet);
467 react(rsReact);
468 }
469
470 // Draw flags array accessors
472 {
473 while (nFlags && *pFlags)
474 setDrawFlag(*pFlags++, kRSIgnoreReactor), nFlags--;
475 react(rsReact);
476 }
478 {
479 while (nFlags && *pFlags)
480 resetDrawFlag(*pFlags++, kRSIgnoreReactor), nFlags--;
481 react(rsReact);
482 }
483
484 // Clear flags
486 {
488 react(rsReact);
489 }
490
491 // Draw flags serialization support
493 {
494 return m_nDrawFlags.getPtr();
495 }
497 {
498 return m_nDrawFlags.getPtr();
499 }
500
501 // Access color properties
502 const Color &color(ColorProps nProp, bool bResolved = true) const
503 {
504 return (!bResolved) ? m_colorProps[nProp] : resolveColor(m_colorProps[nProp]);
505 }
507 {
508 m_colorProps[nProp] = clr;
509 react(rsReact);
510 }
511
512 // Access floating point properties
513 float value(FloatProps nProp) const
514 {
515 return m_floatProps[nProp];
516 }
518 {
519 m_floatProps[nProp] = fVal;
520 react(rsReact);
521 }
522
523 // Access integer properties
525 {
526 return m_intProps[nProp];
527 }
529 {
530 return (OdUInt32)m_intProps[nProp];
531 }
533 {
534 m_intProps[nProp] = nVal;
535 react(rsReact);
536 }
538 {
539 m_intProps[nProp] = (OdInt32)nVal;
540 react(rsReact);
541 }
542
543 // Multipass render settings
545 {
546 if (m_pNextPass[passType].get() != pNextPass)
547 setNextPass(passType, OdTrRndRenderSettingsPtr(pNextPass), rsReact);
548 }
550 {
551 if (m_pNextPass[passType].get() != pNextPass.get())
552 {
553 m_pNextPass[passType] = pNextPass;
554 m_pDifTrans[passType] = NULL;
555 react(rsReact);
556 }
557 }
559 {
560 if (!pNextPass)
561 m_pNextPass[passType] = NULL;
562 else
563 m_pNextPass[passType] = new OdTrRndRenderSettings(*pNextPass);
564 m_pDifTrans[passType] = NULL;
565 react(rsReact);
566 }
570 bool hasNextPass(MultiPassType passType) const
571 {
572 return !m_pNextPass[passType].isNull();
573 }
575 {
576 return m_pNextPass[passType].get();
577 }
579 {
580 return m_pNextPass[passType].get();
581 }
583 {
584 return m_pNextPass[passType];
585 }
587 {
588 return m_pNextPass[passType];
589 }
590
592 {
593 m_pDifTrans[passType] = pDifTrans;
594 }
596 {
597 return m_pDifTrans[passType];
598 }
600 {
601 m_pDifTrans[passType] = NULL;
602 }
603
604 // Multipass support for geometry types
606
607 bool hasNextPass(OdTrVisGeomType geomType) const
608 { const MultiPassType passType = geomTypeMultiPass(geomType);
609 if (passType >= kNumMultiPassTypes) return false;
610 return hasNextPass(passType);
611 }
613 { const MultiPassType passType = geomTypeMultiPass(geomType);
614 if (passType >= kNumMultiPassTypes) return NULL;
615 return nextPass(passType);
616 }
618 { const MultiPassType passType = geomTypeMultiPass(geomType);
619 if (passType >= kNumMultiPassTypes) return NULL;
620 return nextPass(passType);
621 }
623 { const MultiPassType passType = geomTypeMultiPass(geomType);
624 if (passType >= kNumMultiPassTypes) return OdTrRndRenderSettingsPtr();
625 return nextPassPtr(passType);
626 }
628 { const MultiPassType passType = geomTypeMultiPass(geomType);
629 if (passType >= kNumMultiPassTypes) return OdTrRndRenderSettingsPtr();
630 return nextPassPtr(passType);
631 }
632
633 // Render settings reactors
637
638 // Reactor default behavior
642 {
643 react(rsReact);
644 }
645
646 // Extended functions
650 bool isGeomTypeVisible(OdTrVisGeomType geomType) const;
652
653 // Some basic properties access
654 // !RenderMode::depthBufferEnabled
655 bool is2dModeEnabled() const
656 {
657 return drawFlag(kDrawOrder);
658 }
659 // RenderMode::stencilBufferEnabled
661 {
663 }
664 // RenderMode::polygonOffsetEnabled
666 {
669 }
670 // RenderMode::lightingEnabled
672 {
674 }
675 bool isLightingEnabled() const
676 {
677 return drawFlag(kDrawLighting);
678 }
679 // RenderMode::faceNormalsEnabled
681 {
682 return drawFlag(kFaceNormals);
683 }
684 // RenderConfig::isForceDefaultLighting
685 bool isDefaultLighting() const
686 {
688 }
689 // RenderConfig::isHardwareColorModifiersEnabled
691 {
697 }
698
699 // Loading/saving ability
700 bool save(OdGsFiler *pFiler) const;
701 bool load(OdGsFiler *pFiler);
702
703 // Extended properties information
704 static OdUInt32 extendedPropsInfo(const UIPropEntry **ppEntries = NULL);
705 protected:
706 bool loadNextPass(MultiPassType passType, OdGsFiler *pFiler);
707 const Color &resolveColor(const Color &clr) const;
708 void reactImpl();
710 {
711 if ((rsReact == kRSCallReactor) || ((rsReact == kRSReactorDefault) && !GETBIT(m_rsFlags, kSuppressReactor)))
712 reactImpl();
713 }
714};
715
716// Null render settings (applicable as stub for initial render settings switch)
718
719inline
721{
722 switch (geomType)
723 {
740 default: return false;
741 }
742}
743
744inline
746{
747 switch (geomType)
748 {
749 //case OdTrVisGeomType_2dFacets: case OdTrVisGeomType_2dFacetsNoFill: return kMultiPassFor2dFacets;
750 //case OdTrVisGeomType_3dFacets: case OdTrVisGeomType_3dFacetsNoFill: return kMultiPassFor3dFacets;
751 //case OdTrVisGeomType_RasterImageFacets: return kMultiPassForRasterImages;
752 //case OdTrVisGeomType_2dFacetEdges: return kMultiPassFor2dFacetEdges;
753 //case OdTrVisGeomType_3dFacetEdges: case OdTrVisGeomType_EdgesWithIsolines: return kMultiPassFor3dFacetEdges;
754 //case OdTrVisGeomType_Isolines: return kMultiPassForIsolines;
756 //case OdTrVisGeomType_Silhouettes: return kMultiPassForSilhouettes;
757 default: return kNumMultiPassTypes;
758 }
759}
760
761inline
763{
764 switch (clr.m_colorType)
765 {
766 case kColorBackground: return color(kPropBackgroundColor, false);
767 case kColorForeground: return color(kPropForegroundColor, false);
768 default: break;
769 }
770 return clr;
771}
772
777{
778 public:
780 {
782 kRSViewportPS = (1 << 1),
784 kRSViewportHelper = (1 << 3)
785 };
786 public:
789
790 virtual OdUInt32 rsNumViewports() const = 0;
791
792 virtual OdTrVisViewportId rsViewportId(OdUInt32 numViewport) const = 0;
793 virtual OdUInt32 rsViewportFlags(OdUInt32 numViewport) const = 0;
794
795 virtual void rsViewportSettings(OdUInt32 numViewport, OdTrRndRenderSettingsPtr &rs) const = 0;
797
798 virtual bool rsIsViewportRenderModeOverride(OdUInt32 numViewport) const = 0;
799 virtual void rsSetViewportRenderModeOverride(OdUInt32 numViewport, bool bOverride) = 0;
800 virtual void rsApplyViewportRenderModeOverride(OdUInt32 numViewport) = 0;
801};
802
803#include "TD_PackPop.h"
804
805#endif // ODTRRNDRENDERSETTINGS
#define ODCOLORREF
Definition: OdPlatform.h:933
#define ODRGBA(r, g, b, a)
Definition: OdPlatform.h:935
unsigned int OdUInt32
unsigned short OdUInt16
int OdInt32
unsigned char OdUInt8
wchar_t OdChar
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:516
#define SETBIT_0(flags, bit)
Definition: OdaDefs.h:519
#define GETBIT(flags, bit)
Definition: OdaDefs.h:517
#define SETBIT_1(flags, bit)
Definition: OdaDefs.h:520
OdStaticDefSharedPtr< OdTrRndRenderSettings > OdTrRndRenderSettingsStaticPtr
OdSharedPtr< OdTrRndRenderSettings > OdTrRndRenderSettingsPtr
OdTrRndRenderSettingsStaticPtr kTrRndNullRenderSettings
OdTrRndRSUpdateReactor
@ kRSCallReactor
@ kRSReactorDefault
@ kRSIgnoreReactor
OdTrVisGeomType
@ OdTrVisGeomType_3dFacetsNoFill
@ OdTrVisGeomType_HatchIsolineEdges
@ OdTrVisGeomType_Silhouettes
@ OdTrVisGeomType_2dFacetEdges
@ OdTrVisGeomType_Isolines
@ OdTrVisGeomType_3dFacetEdges
@ OdTrVisGeomType_2dFacets
@ OdTrVisGeomType_FillPatternEdges
@ OdTrVisGeomType_Default
@ OdTrVisGeomType_RasterImageFacets
@ OdTrVisGeomType_2dFacetsNoFill
@ OdTrVisGeomType_EdgesWithIsolines
@ OdTrVisGeomType_3dFacets
@ OdTrVisGeomType_IntersectionEdges
RenderMode
Definition: Gs.h:148
@ k2DOptimized
Definition: Gs.h:150
bool isNull() const
Definition: SharedPtr.h:163
T * get()
Definition: SharedPtr.h:134
void set(OdUInt32 nFlag, bool bSet)
bool get(OdUInt32 nFlag) const
void addReactor(OdTrRndRenderSettingsReactor *pReactor)
void setNextPass(MultiPassType passType, const OdTrRndRenderSettingsPtr &pNextPass, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
void setNextPass(MultiPassType passType, OdTrRndRenderSettings *pNextPass, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
OdTrRndRenderSettings(const OdTrRndRenderSettings &rs)
bool isFaceColorOverrideEnabled() const
OdUInt32 valueU(IntegerProps nProp) const
OdGsView::RenderMode renderMode() const
const OdTrRndDifferentialTransitionPtr & differentialTransition(MultiPassType passType) const
static OdUInt32 make_edgesStyle(OdPs::LineEndStyle lesStyle, OdPs::LineJoinStyle ljsStyle)
const OdUInt8 * serializationFlagsPtr() const
OdUInt32 makeGeomMarkerVisibilities() const
OdArray< OdTrRndRenderSettingsReactor *, OdMemoryAllocator< OdTrRndRenderSettingsReactor * > > m_reactors
bool loadNextPass(MultiPassType passType, OdGsFiler *pFiler)
OdTrRndRenderSettings * nextPass(MultiPassType passType)
void resetDrawFlag(OdUInt32 nFlag, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
bool hasNextPass(MultiPassType passType) const
void resetDrawFlags(const OdUInt32 *pFlags, OdUInt32 nFlags=kNumFlags, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
void setLastPass(MultiPassType passType, const OdTrRndRenderSettingsPtr &pNextPass, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
void setValue(IntegerProps nProp, OdInt32 nVal, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
static CreaseFlags creaseFlagDecode(OdUInt32 flags)
Color m_colorProps[kNumColorProps]
void setReactorDefault(OdTrRndRSUpdateReactor rsDefault)
static OdPs::LineJoinStyle get_lineJoinStyle(OdUInt32 lineStyle)
OdTrRndRenderSettingsPtr nextPassPtr(OdTrVisGeomType geomType)
void setRenderMode(OdGsView::RenderMode rMode, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
void setRenderModeOverride(bool bSet, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
OdTrRndRenderSettingsPtr m_pNextPass[kNumMultiPassTypes]
OdTrRndRenderSettings * nextPass(OdTrVisGeomType geomType)
OdGsView::RenderMode m_renderMode
MultiPassType geomTypeMultiPass(OdTrVisGeomType geomType) const
bool save(OdGsFiler *pFiler) const
void setLastPass(MultiPassType passType, OdTrRndRenderSettings *pNextPass, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
bool drawFlag(OdUInt32 nFlag) const
const Color & resolveColor(const Color &clr) const
float m_floatProps[kNumFloatProps]
void forceReactorUpdate(OdTrRndRSUpdateReactor rsReact=kRSCallReactor)
OdTrRndRSUpdateReactor reactorDefault() const
bool isGeomTypeVisible(OdTrVisGeomType geomType) const
OdInt32 m_intProps[kNumIntegerProps]
void removeReactor(OdTrRndRenderSettingsReactor *pReactor)
void setDrawFlag(OdUInt32 nFlag, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
OdTrRndRenderSettingsPtr & nextPassPtr(MultiPassType passType)
void setNextPassCopy(MultiPassType passType, const OdTrRndRenderSettings *pNextPass, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
void setDrawFlags(const OdUInt32 *pFlags, OdUInt32 nFlags=kNumFlags, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
void setLastPassCopy(MultiPassType passType, const OdTrRndRenderSettings *pNextPass, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
OdTrRndRenderSettingsPtr searchPassId(OdUInt16 passId, OdTrRndRenderSettingsPtr pSelfPtr=OdTrRndRenderSettingsPtr(), OdUInt16 passMask=0xFFFF, bool bSearchNested=true) const
const OdTrRndRenderSettings * nextPass(MultiPassType passType) const
void setForRenderMode(OdGsView::RenderMode rm, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
bool hasReactor(OdTrRndRenderSettingsReactor *pReactor) const
static OdUInt32 extendedPropsInfo(const UIPropEntry **ppEntries=NULL)
bool hasNextPass(OdTrVisGeomType geomType) const
static OdPs::LineEndStyle get_lineEndStyle(OdUInt32 lineStyle)
OdTrRndRenderSettings(OdGsView::RenderMode initialRenderMode=OdGsView::k2DOptimized, OdTrRndRSUpdateReactor rsDefault=kRSCallReactor)
void setPassId(OdUInt16 nPassId, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
void clearDrawFlags(OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
OdTrRndRenderSettings & operator=(const OdTrRndRenderSettings &rs)
void react(OdTrRndRSUpdateReactor rsReact)
void setDrawFlag(OdUInt32 nFlag, bool bSet, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
static CreaseFlags get_creaseFilterBack(OdUInt32 creaseFilter)
void setValueU(IntegerProps nProp, OdUInt32 nVal, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
void setColor(ColorProps nProp, const Color &clr, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
void setValue(FloatProps nProp, float fVal, OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
void resolveByViewportDef(const OdTrVisViewportShadingDef &vpDef)
static OdUInt32 make_creaseFilter(CreaseFilterDefault defFilter)
static CreaseFlags get_creaseFilterFront(OdUInt32 creaseFilter)
BitSet< kNumFlagRegs > m_nDrawFlags
OdInt32 value(IntegerProps nProp) const
OdTrRndDifferentialTransitionPtr m_pDifTrans[kNumMultiPassTypes]
const OdTrRndRenderSettingsPtr nextPassPtr(OdTrVisGeomType geomType) const
bool isColorModifiersEnabled() const
void setPropsDefault(OdTrRndRSUpdateReactor rsReact=kRSReactorDefault)
bool is3dFacesWithLinesEnabled() const
static OdUInt32 make_creaseFilter(CreaseFlags frontLimit, CreaseFlags backLimit)
const OdTrRndRenderSettingsPtr & nextPassPtr(MultiPassType passType) const
bool load(OdGsFiler *pFiler)
static OdUInt32 creaseFlagEncode(CreaseFlags flags)
float value(FloatProps nProp) const
void resetDifferentialTransition(MultiPassType passType)
const OdTrRndRenderSettings * nextPass(OdTrVisGeomType geomType) const
const Color & color(ColorProps nProp, bool bResolved=true) const
void setDifferentialTransition(MultiPassType passType, const OdTrRndDifferentialTransitionPtr &pDifTrans)
virtual OdUInt32 rsNumViewports() const =0
virtual void rsViewportSettings(OdUInt32 numViewport, OdTrRndRenderSettingsPtr &rs) const =0
virtual OdTrRndRenderSettings & rsViewportSettings(OdUInt32 numViewport)=0
virtual OdUInt32 rsViewportFlags(OdUInt32 numViewport) const =0
virtual bool rsIsViewportRenderModeOverride(OdUInt32 numViewport) const =0
virtual void rsSetViewportRenderModeOverride(OdUInt32 numViewport, bool bOverride)=0
virtual OdTrVisViewportId rsViewportId(OdUInt32 numViewport) const =0
virtual void rsApplyViewportRenderModeOverride(OdUInt32 numViewport)=0
virtual void renderSettingsChanged(OdTrRndRenderSettings *pRSets)=0
LineJoinStyle
Definition: PlotStyles.h:78
LineEndStyle
Definition: PlotStyles.h:69
Color(ColorType colorType=kColorBackground, ODCOLORREF colorVal=ODRGBA(0, 0, 0, 255))
OdUInt32 m_nLinkUIId1
PropType m_propType
UIPropRanges m_ranges
OdUInt32 m_nLinkUIId2
UIDefVal m_defaultVal
OdUInt32 m_nPropCode
const OdChar * m_pName
UIPropRanges(OdInt32 intMin, OdInt32 intMax)
UIPropRanges(OdUInt32 uintMin, OdUInt32 uintMax)
UIPropRanges(float fltMin, float fltMax)
struct OdTrRndRenderSettings::UIDefVal::ColorProp m_colorProp
UIDefVal(ColorType colorType, ODCOLORREF colorVal=ODRGBA(0, 0, 0, 255))