C++
enum SetAttributesFlags { kDrawableNone = 0, kDrawableIsAnEntity = 1, kDrawableUsesNesting = 2, kDrawableIsCompoundObject = 4, kDrawableViewIndependentViewportDraw = 8, kDrawableIsInvisible = 16, kDrawableHasAttributes = 32, kDrawableRegenTypeDependentGeometry = 64, kDrawableIsDimension = (kDrawableIsAnEntity + kDrawableIsCompoundObject + 128), kDrawableRegenDraw = 256, kDrawableStandardDisplaySingleLOD = 512, kDrawableShadedDisplaySingleLOD = 1024, kDrawableViewDependentViewportDraw = 2048, kDrawableBlockDependentViewportDraw = 4096, kDrawableIsExternalReference = 8192, kDrawableNotPlottable = 16384, kDrawableNotAllowLCS = 32768, kDrawableMergeControlOff = 65536, kThreadedWorldDrawViewportDraw = 131072, kDrawableManagesChildDrawables = 262144, kDrawableInheritsSelectionMarker = 524288 };
File
drawable.h
Members
Members | Description |
---|---|
kDrawableNone | Default drawable; just uses AcGi primitives and does not use nested calls to draw(). |
kDrawableIsAnEntity | AcDbEntity-derived classes may require some special processing and must return this flag. The default implementation of AcDbEntity::setAttributes() takes care of specifying this flag for you. |
kDrawableUsesNesting | Uses nesting but does not send down additional primitives. It uses draw() exclusively and makes no calls to the other AcGi primitives such as circle or shell. An example of this type of drawable would be an AcDbBlockTableRecord. |
kDrawableIsCompoundObject | You MUST specify this value if you nest entities as a block does. Gives full access to the AcGi API, enabling the use of draw() and the AcGi primitives together. This flag notifies that graphics system that this object wishes to behave like a block in the graphics system. It is only valid when combined with the kDrawableIsAnEntity flag. If you specify this flag, you must also override AcDbEntity::getCompoundObjectTransform(). A compound object has no directly selectable geometry other than the nested objects that it renders via the AcGiGeometry::draw() method. Enabling this makes the elaboration of an object marginally slower, so you should use this flag only as necessary. |
kDrawableViewIndependentViewportDraw | Specifies view-independent viewport draw behavior in the GS. When this flag is specified, the GS will leave it up to you to decide when viewportDraw() should again be called on this drawable after the initial regen. Between calls to viewportDraw(), the GS will draw cached graphics for this drawable. You can notify the GS when it should call viewportDraw again by calling any one of these three APIs:AcGsView::invalidateCachedViewportGeometry(), AcGsModel::invalidate(kInvalidateViewportCache), and AcGsModel::onModified().This flag is mutually exclusive with kDrawableViewDependentViewportDraw. |
kDrawableIsInvisible | Indicates that this object is invisible and need not be rendered. The default implementation of AcDbEntity::setAttributes() checks the visibility status of the entity and sets this flag appropriately. This flag may also be used to indicate that worldDraw() and viewportDraw() are no-ops and may be skipped for optimization purposes. |
kDrawableHasAttributes | Used in combination with kDrawableIsCompoundObject, this flag indicates that one or more AcDbAttributes will follow the nested objects. This flag is set by the default implementation of AcDbBlockReference::setAttributes(). If this flag is specified, then the drawable must call AcGiWorldGeometry::startAttributesSegment() and send one or more AcDbAttributes to the GS at the end of its worldDraw. Drawables issuing this flag may not use viewportDraw. |
kDrawableRegenTypeDependentGeometry | If the geometry you elaborate is dependent on AcGiRegenType, specify this flag. Specifically, if your drawable draws itself as shaded facets in kAcGiShadedDisplay regen type, but as wireframe in kAcGiStandardDisplay, then specify this flag. |
kDrawableIsDimension | Dimensions receive special handling, behaving similarly to blocks but with some differences. This flag is set by the default implementation of AcDbDimension. This flag should not be specified for objects other than dimensions. |
kDrawableRegenDraw | Instructs the GS to regenerate this drawable on every display redraw. Use this flag only as a last resort, due to the overhead of regenerating the drawable on every redraw. |
kDrawableStandardDisplaySingleLOD | Instructs the the graphics system that the drawable has a single level of detail (LOD) for regen type kAcGiStandardDisplay. |
kDrawableShadedDisplaySingleLOD | Instructs the graphics system that the drawable has a single level of detail (LOD) for regen type kAcGiShadedDisplay. |
kDrawableViewDependentViewportDraw | Specifies view-dependent viewport draw behavior in the GS. When this flag is specified, the GS will call viewportDraw() on this drawable whenever the view changes in any way. This flag is only slightly less expensive than kDrawableRegenDraw, as it will incur a regen on every camera change. So use it only if really necessary. This flag is mutually exclusive with kDrawableViewIndependentViewportDraw. |
kDrawableBlockDependentViewportDraw | Instructs the GS that this drawable has a unique viewportDraw elaboration for each block path. This can be used in combination with either one of the other two GS viewport draw flags kDrawableViewIndependentViewportDraw and kDrawableViewDependentViewportDraw. |
kDrawableIsExternalReference | Drawable is an external reference. |
kDrawableNotPlottable | Drawable will not be plotted. |
kDrawableNotAllowLCS | Drawable will never be drawn under the LCS mechanism |
kDrawableMergeControlOff | Use this wipeout plotting to pdf. |
kThreadedWorldDrawViewportDraw | Drawable supports threaded worldDraw/viewportDraw calls |
kDrawableManagesChildDrawables | Drawable manages the lifetime of child drawables |
kDrawableInheritsSelectionMarker | When this flag is set, the drawable does not reset GsMarker to 0 and instead uses what the parent drawable last set. This flag makes 3D behave like 2D Wireframe in this regard. |
Description
Combine these flags in the return value of setAttributes to control regeneration behavior and maximize redraw efficiency. It is vital to specify the correct flags, otherwise the display system may be incorrectly configured for subsequent graphics.
Previous Declaration
AutoCAD 2024
enum SetAttributesFlags {
kDrawableNone = 0,
kDrawableIsAnEntity = 1,
kDrawableUsesNesting = 2,
kDrawableIsCompoundObject = 4,
kDrawableViewIndependentViewportDraw = 8,
kDrawableIsInvisible = 16,
kDrawableHasAttributes = 32,
kDrawableRegenTypeDependentGeometry = 64,
kDrawableIsDimension = (kDrawableIsAnEntity + kDrawableIsCompoundObject + 128),
kDrawableRegenDraw = 256,
kDrawableStandardDisplaySingleLOD = 512,
kDrawableShadedDisplaySingleLOD = 1024,
kDrawableViewDependentViewportDraw = 2048,
kDrawableBlockDependentViewportDraw = 4096,
kDrawableIsExternalReference = 8192,
kDrawableNotPlottable = 16384,
kDrawableNotAllowLCS = 32768,
kDrawableMergeControlOff = 65536,
kThreadedWorldDrawViewportDraw = 131072,
kDrawableManagesChildDrawables = 262144
};
AutoCAD 2021 through AutoCAD 2023
enum SetAttributesFlags {
kDrawableNone = 0,
kDrawableIsAnEntity = 1,
kDrawableUsesNesting = 2,
kDrawableIsCompoundObject = 4,
kDrawableViewIndependentViewportDraw = 8,
kDrawableIsInvisible = 16,
kDrawableHasAttributes = 32,
kDrawableRegenTypeDependentGeometry = 64,
kDrawableIsDimension = (kDrawableIsAnEntity + kDrawableIsCompoundObject + 128),
kDrawableRegenDraw = 256,
kDrawableStandardDisplaySingleLOD = 512,
kDrawableShadedDisplaySingleLOD = 1024,
kDrawableViewDependentViewportDraw = 2048,
kDrawableBlockDependentViewportDraw = 4096,
kDrawableIsExternalReference = 8192,
kDrawableNotPlottable = 16384,
kDrawableNotAllowLCS = 32768,
kDrawableMergeControlOff = 65536,
kThreadedWorldDrawViewportDraw = 131072
};
AutoCAD 2020 and Earlier
enum SetAttributesFlags {
kDrawableNone = 0,
kDrawableIsAnEntity = 1,
kDrawableUsesNesting = 2,
kDrawableIsCompoundObject = 4,
kDrawableViewIndependentViewportDraw = 8,
kDrawableIsInvisible = 16,
kDrawableHasAttributes = 32,
kDrawableRegenTypeDependentGeometry = 64,
kDrawableIsDimension = (kDrawableIsAnEntity + kDrawableIsCompoundObject + 128),
kDrawableRegenDraw = 256,
kDrawableStandardDisplaySingleLOD = 512,
kDrawableShadedDisplaySingleLOD = 1024,
kDrawableViewDependentViewportDraw = 2048,
kDrawableBlockDependentViewportDraw = 4096,
kDrawableIsExternalReference = 8192,
kDrawableNotPlottable = 16384,
kDrawableNotAllowLCS = 32768,
kDrawableMergeControlOff = 65536
};
History
AutoCAD 2025
Constant kDrawableInheritsSelectionMarker was added.
AutoCAD 2024
Constant kDrawableManagesChildDrawables was added.