CFx SDK Documentation  2020SP3
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 
FIRSTDLL_EXPORT
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
OdResult
OdResult
Definition: OdResult.h:29
OdGiDrawableOverrule::OdGiDrawableOverrule
OdGiDrawableOverrule()
OdGiDrawable::kWebLight
@ kWebLight
Definition: GiDrawable.h:97
OdGiDrawable::isPersistent
virtual bool isPersistent() const =0
OdGiDrawableOverrule::regenSupportFlags
virtual OdUInt32 regenSupportFlags(const OdGiDrawable *pSubject)
OdGiDrawable::id
virtual OdDbStub * id() const =0
OdGiDrawable::getGeomExtents
virtual OdResult getGeomExtents(OdGeExtents3d &extents) const
OdGiDrawableOverrule::viewportDraw
virtual void viewportDraw(const OdGiDrawable *pSubject, OdGiViewportDraw *vd)
OdRxObject
Definition: RxObject.h:564
OdGiDrawable::kAmbientLight
@ kAmbientLight
Definition: GiDrawable.h:91
OdGsCache
Definition: GsModel.h:40
OdGiDrawable::kSkyBackground
@ kSkyBackground
Definition: GiDrawable.h:98
TD_PackPop.h
OdGiDrawableOverrule::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdGiDrawableOverrule)
RxObject.h
OdGiDrawable::regenSupportFlags
ODRX_SEALED_VIRTUAL OdUInt32 regenSupportFlags() const ODRX_SEALED
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGiDrawableOverrule::worldDraw
virtual bool worldDraw(const OdGiDrawable *pSubject, OdGiWorldDraw *wd)
ODRX_SEALED
#define ODRX_SEALED
Definition: OdPlatformSettings.h:118
OdGiDrawable::gsNode
virtual OdGsCache * gsNode() const =0
OdGiDrawable::kGroundPlaneBackground
@ kGroundPlaneBackground
Definition: GiDrawable.h:95
ODRX_SEALED_VIRTUAL
#define ODRX_SEALED_VIRTUAL
Definition: OdPlatformSettings.h:119
OdGiDrawable::viewportDrawLogicalFlags
ODRX_SEALED_VIRTUAL OdUInt32 viewportDrawLogicalFlags(OdGiViewportDraw *pVd) const ODRX_SEALED
OdGiDrawable::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdGiDrawable)
OdGiDrawable::kImageBackground
@ kImageBackground
Definition: GiDrawable.h:94
OdSmartPtr
Definition: SmartPtr.h:58
OdGiDrawableOverrule
Definition: GiDrawable.h:235
OdGiDrawable::viewportDraw
ODRX_SEALED_VIRTUAL void viewportDraw(OdGiViewportDraw *pVd) const ODRX_SEALED
OdGiDrawable::drawableType
virtual DrawableType drawableType() const
Definition: GiDrawable.h:102
OdGiDrawable
Definition: GiDrawable.h:49
OdGiDrawable::kGradientBackground
@ kGradientBackground
Definition: GiDrawable.h:93
OdGiDrawable::kSolidBackground
@ kSolidBackground
Definition: GiDrawable.h:92
OdRxOverrule
Definition: RxOverrule.h:42
OdGiDrawable::setGsNode
virtual void setGsNode(OdGsCache *pGsNode)=0
TD_PackPush.h
OdGiDrawable::worldDraw
ODRX_SEALED_VIRTUAL bool worldDraw(OdGiWorldDraw *pWd) const ODRX_SEALED
OdGiDrawable::setAttributes
ODRX_SEALED_VIRTUAL OdUInt32 setAttributes(OdGiDrawableTraits *pTraits) const ODRX_SEALED
OdGiDrawable::OdGiDrawable
OdGiDrawable()
OdGiWorldDraw
Definition: GiWorldDraw.h:44
OdGiDrawable::kViewport
@ kViewport
Definition: GiDrawable.h:96
OdGiDrawableTraits
Definition: Gi.h:71
OdGiDrawable::DrawableType
DrawableType
Definition: GiDrawable.h:86
OdGeExtents3d
Definition: GeExtents3d.h:45
OdGiDrawableOverrule::viewportDrawLogicalFlags
virtual OdUInt32 viewportDrawLogicalFlags(const OdGiDrawable *pSubject, OdGiViewportDraw *vd)
OdGiDrawableOverrule::setAttributes
virtual OdUInt32 setAttributes(const OdGiDrawable *pSubject, OdGiDrawableTraits *traits)
RxOverrule.h
OdGiDrawable::SetAttributesFlags
SetAttributesFlags
Definition: GiDrawable.h:57
OdGiViewportDraw
Definition: GiViewportDraw.h:50