CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
GiDrawable.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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-2024 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
24#ifndef __ODDRAWABLE_H__
25#define __ODDRAWABLE_H__ /* { Secret} **/
26
27#include "RxObject.h"
28#include "RxOverrule.h"
29
31class OdGiWorldDraw;
33class OdGsCache;
34class OdDbStub;
35class OdGeExtents3d;
36
37#include "TD_PackPush.h"
38
47class FIRSTDLL_EXPORT OdGiDrawable : public OdRxObject
48{
49protected:
51public:
52
54
58 {
59 kDrawableNone = 0, // Default flags; the drawable object uses only OdGi primitives,
60 // with no nested calls to draw().
61 kDrawableIsAnEntity = 1, // Classes derived from OdDbEntity must set this flag,
62 // which is set by the default implementation of
63 // OdDbEntity::subSetAttributes().
64 kDrawableUsesNesting = 2, // The drawable uses nested calls to draw(), but makes no
65 // calls to other OdGi primatives.
66 kDrawableIsCompoundObject = 4, // The drawable is to be treated as a block. Valid only when combined
67 // with kDrawableIsAnEntity. If set, you must override
68 // OdDbEntity::getCompoundObjectTransform().
69 kDrawableViewIndependentViewportDraw = 8, // Currently not supported.
70 kDrawableIsInvisible = 16, // Object is invisible, and should not be rendered.
71 kDrawableHasAttributes = 32, // Currently not supported.
72 kDrawableRegenTypeDependantGeometry = 64, // This flag must be set for objects which is drawn differently in different regen type modes.
73 kDrawableIsDimension = (kDrawableIsAnEntity + kDrawableIsCompoundObject + 128), // Dimension objects must set these flags
74 // which are set by the default implementation of OdDbDimension.
75 kDrawableRegenDraw = 256, // The drawable must be always regenerated.
76 kDrawableStandardDisplaySingleLOD = 512, // Currently not supported.
77 kDrawableShadedDisplaySingleLOD = 1024, // Currently not supported.
78 kDrawableViewDependentViewportDraw = 2048, // Currently not supported.
79 kDrawableBlockDependentViewportDraw = 4096, // Currently not supported.
80 kDrawableIsExternalReference = 8192, // Currently not supported.
81 kDrawableNotPlottable = 16384, // Currently not supported.
82 kDrawableNotAllowLCS = 32768, // Currently not supported.
83 kDrawableMergeControlOff = 65536, // Merge Control disabled for this drawable
84
86 };
87
91 {
92 kGeometry = 0, // Geometry.
93 kDistantLight = 1, // Distant light. This number is important!
94 kPointLight = 2, // Point light. This number is important!
95 kSpotLight = 3, // Spot light. This number is important!
96 kAmbientLight, // Ambient light.
97 kSolidBackground, // Solid background light.
98 kGradientBackground, // Gradient background.
99 kImageBackground, // Image background.
100 kGroundPlaneBackground, // Ground plane background.
101 kViewport, // Viewport.
102 kWebLight, // Web light.
103 kSkyBackground, // Sky background.
104 kImageBasedLightingBackground, // Image-based lightning background.
105 //
106 kEnvironmentBackground = 16, // Environment background.
107 kCustomBackground // User-defined background.
108 };
109
116 virtual DrawableType drawableType() const { return kGeometry; }
117
131
152
171
178 virtual bool isPersistent() const = 0;
179
189 virtual OdDbStub* id() const = 0;
190
196 virtual void setGsNode(OdGsCache* pGsNode) = 0;
197
204 virtual OdGsCache* gsNode() const = 0;
205
218
229 virtual OdResult getGeomExtents(OdGeExtents3d& extents) const;
230
240
241protected:
242 virtual OdUInt32 subSetAttributes (OdGiDrawableTraits * traits) const = 0;
243 virtual bool subWorldDraw (OdGiWorldDraw * wd) const = 0;
244 virtual void subViewportDraw (OdGiViewportDraw * vd) const = 0;
248};
249
254
264{
265public:
267
272
282 virtual OdUInt32 setAttributes (const OdGiDrawable* pSubject, OdGiDrawableTraits * traits);
283
294 virtual bool worldDraw (const OdGiDrawable* pSubject, OdGiWorldDraw * wd);
295
302 virtual void viewportDraw (const OdGiDrawable* pSubject, OdGiViewportDraw * vd);
303
314
323 virtual OdUInt32 regenSupportFlags(const OdGiDrawable* pSubject);
324};
325
326#include "TD_PackPop.h"
327
328#endif // __ODDRAWABLE_H__
329
OdSmartPtr< OdGiDrawable > OdGiDrawablePtr
#define ODRX_FINAL
unsigned int OdUInt32
#define ODRX_SEALED_VIRTUAL
OdResult
Definition OdResult.h:29
#define FIRSTDLL_EXPORT
Definition RootExport.h:39
virtual OdUInt32 subRegenSupportFlags() const
ODRX_DECLARE_MEMBERS(OdGiDrawable)
virtual bool isPersistent() const =0
virtual void setGsNode(OdGsCache *pGsNode)=0
ODRX_SEALED_VIRTUAL void viewportDraw(OdGiViewportDraw *pVd) const ODRX_FINAL
virtual OdUInt32 subViewportDrawLogicalFlags(OdGiViewportDraw *vd) const
virtual OdDbStub * id() const =0
virtual bool subWorldDraw(OdGiWorldDraw *wd) const =0
friend class OdGiDrawableOverrule
Definition GiDrawable.h:247
ODRX_SEALED_VIRTUAL OdUInt32 setAttributes(OdGiDrawableTraits *pTraits) const ODRX_FINAL
ODRX_SEALED_VIRTUAL OdUInt32 regenSupportFlags() const ODRX_FINAL
virtual DrawableType drawableType() const
Definition GiDrawable.h:116
@ kDrawableIsAnEntity
Definition GiDrawable.h:61
@ kDrawableNotAllowLCS
Definition GiDrawable.h:82
@ kDrawableNotPlottable
Definition GiDrawable.h:81
@ kDrawableShadedDisplaySingleLOD
Definition GiDrawable.h:77
@ kDrawableUsesNesting
Definition GiDrawable.h:64
@ kDrawableBlockDependentViewportDraw
Definition GiDrawable.h:79
@ kDrawableIsCompoundObject
Definition GiDrawable.h:66
@ kDrawableIsInvisible
Definition GiDrawable.h:70
@ kDrawableViewIndependentViewportDraw
Definition GiDrawable.h:69
@ kDrawableHasAttributes
Definition GiDrawable.h:71
@ kDrawableRegenTypeDependantGeometry
Definition GiDrawable.h:72
@ kDrawableIsExternalReference
Definition GiDrawable.h:80
@ kDrawableIsDimension
Definition GiDrawable.h:73
@ kDrawableMergeControlOff
Definition GiDrawable.h:83
@ kDrawableViewDependentViewportDraw
Definition GiDrawable.h:78
@ kDrawableStandardDisplaySingleLOD
Definition GiDrawable.h:76
virtual OdUInt32 subSetAttributes(OdGiDrawableTraits *traits) const =0
ODRX_SEALED_VIRTUAL OdUInt32 viewportDrawLogicalFlags(OdGiViewportDraw *pVd) const ODRX_FINAL
virtual OdGsCache * gsNode() const =0
@ kGroundPlaneBackground
Definition GiDrawable.h:100
@ kEnvironmentBackground
Definition GiDrawable.h:106
@ kGradientBackground
Definition GiDrawable.h:98
@ kImageBasedLightingBackground
Definition GiDrawable.h:104
ODRX_SEALED_VIRTUAL bool worldDraw(OdGiWorldDraw *pWd) const ODRX_FINAL
virtual void subViewportDraw(OdGiViewportDraw *vd) const =0
virtual OdResult getGeomExtents(OdGeExtents3d &extents) const
virtual OdUInt32 setAttributes(const OdGiDrawable *pSubject, OdGiDrawableTraits *traits)
virtual void viewportDraw(const OdGiDrawable *pSubject, OdGiViewportDraw *vd)
ODRX_DECLARE_MEMBERS(OdGiDrawableOverrule)
virtual OdUInt32 regenSupportFlags(const OdGiDrawable *pSubject)
virtual bool worldDraw(const OdGiDrawable *pSubject, OdGiWorldDraw *wd)
virtual OdUInt32 viewportDrawLogicalFlags(const OdGiDrawable *pSubject, OdGiViewportDraw *vd)