CFx SDK Documentation  2022 SP0
GiDrawable.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 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 
30 class OdGiDrawableTraits;
31 class OdGiWorldDraw;
32 class OdGiViewportDraw;
33 class OdGsCache;
34 class OdDbStub;
35 class OdGeExtents3d;
36 
37 #include "TD_PackPush.h"
38 
49 {
50 protected:
52 public:
53 
55 
57  {
58  kDrawableNone = 0, // Default flags; the drawable object uses only OdGi primitives,
59  // with no nested calls to draw().
60  kDrawableIsAnEntity = 1, // Classes derived from OdDbEntity must set this flag,
61  // which is set by the default implementation of
62  // OdDbEntity::subSetAttributes().
63  kDrawableUsesNesting = 2, // The drawable uses nested calls to draw(), but makes no
64  // calls to other OdGi primatives.
65  kDrawableIsCompoundObject = 4, // The drawable is to be treated as a block. Valid only when combined
66  // with kDrawableIsAnEntity. If set, you must override
67  // OdDbEntity::getCompoundObjectTransform().
68  kDrawableViewIndependentViewportDraw = 8, // Currently not supported.
69  kDrawableIsInvisible = 16, // Object is invisible, and should not be rendered.
70  kDrawableHasAttributes = 32, // Currently not supported.
71  kDrawableRegenTypeDependantGeometry = 64, // This flag must be set for objects which is drawn differently in different regen type modes.
72  kDrawableIsDimension = (kDrawableIsAnEntity + kDrawableIsCompoundObject + 128), // Dimension objects must set these flags
73  // which are set by the default implementation of OdDbDimension.
74  kDrawableRegenDraw = 256, // The drawable must be always regenerated.
75  kDrawableStandardDisplaySingleLOD = 512, // Currently not supported.
76  kDrawableShadedDisplaySingleLOD = 1024, // Currently not supported.
77  kDrawableViewDependentViewportDraw = 2048, // Currently not supported.
78  kDrawableBlockDependentViewportDraw = 4096, // Currently not supported.
79  kDrawableIsExternalReference = 8192, // Currently not supported.
80  kDrawableNotPlottable = 16384, // Currently not supported.
81 
82  kLastFlag = kDrawableNotPlottable // Marker
83  };
84 
86  {
87  kGeometry = 0,
88  kDistantLight = 1, // this number is important!
89  kPointLight = 2, // this number is important!
90  kSpotLight = 3, // this number is important!
99  kImageBasedLightingBackground
100  };
101 
102  virtual DrawableType drawableType() const { return kGeometry; }
103 
117 
138 
157 
161  virtual bool isPersistent() const = 0;
162 
169  virtual OdDbStub* id() const = 0;
170 
176  virtual void setGsNode(OdGsCache* pGsNode) = 0;
177 
181  virtual OdGsCache* gsNode() const = 0;
182 
192 
203  virtual OdResult getGeomExtents(OdGeExtents3d& extents) const;
204 
214 
215 protected:
216  virtual OdUInt32 subSetAttributes (OdGiDrawableTraits * traits) const = 0;
217  virtual bool subWorldDraw (OdGiWorldDraw * wd) const = 0;
218  virtual void subViewportDraw (OdGiViewportDraw * vd) const = 0;
219  virtual OdUInt32 subViewportDrawLogicalFlags (OdGiViewportDraw * vd) const;
220  virtual OdUInt32 subRegenSupportFlags() const;
221  friend class OdGiDrawableOverrule;
222 };
223 
225 
235 {
236 public:
238 
243 
250  virtual OdUInt32 setAttributes (const OdGiDrawable* pSubject, OdGiDrawableTraits * traits);
251 
258  virtual bool worldDraw (const OdGiDrawable* pSubject, OdGiWorldDraw * wd);
259 
266  virtual void viewportDraw (const OdGiDrawable* pSubject, OdGiViewportDraw * vd);
267 
275 
281  virtual OdUInt32 regenSupportFlags(const OdGiDrawable* pSubject);
282 };
283 
284 #include "TD_PackPop.h"
285 
286 #endif // __ODDRAWABLE_H__
287 
unsigned int OdUInt32
#define ODRX_SEALED_VIRTUAL
#define ODRX_SEALED
OdResult
Definition: OdResult.h:29
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
ODRX_SEALED_VIRTUAL void viewportDraw(OdGiViewportDraw *pVd) const ODRX_SEALED
ODRX_DECLARE_MEMBERS(OdGiDrawable)
virtual bool isPersistent() const =0
ODRX_SEALED_VIRTUAL OdUInt32 setAttributes(OdGiDrawableTraits *pTraits) const ODRX_SEALED
virtual void setGsNode(OdGsCache *pGsNode)=0
ODRX_SEALED_VIRTUAL OdUInt32 viewportDrawLogicalFlags(OdGiViewportDraw *pVd) const ODRX_SEALED
ODRX_SEALED_VIRTUAL OdUInt32 regenSupportFlags() const ODRX_SEALED
virtual DrawableType drawableType() const
Definition: GiDrawable.h:102
ODRX_SEALED_VIRTUAL bool worldDraw(OdGiWorldDraw *pWd) const ODRX_SEALED
virtual OdDbStub * id() const =0
@ kSolidBackground
Definition: GiDrawable.h:92
@ kImageBackground
Definition: GiDrawable.h:94
@ kGroundPlaneBackground
Definition: GiDrawable.h:95
@ kGradientBackground
Definition: GiDrawable.h:93
virtual OdGsCache * gsNode() 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)