The OdPrcGraphics class has a set of bits that controls visibility, color, material and some other aspects of graphical entity behavior. This bit field contains 16 bits, therefore it can be represented with an OdUInt16 value. To operate on the current state of behavior bit field, OdPrcGraphics class provides two methods:
Behavior parameter values are represented in the following table. Definitions of appropriate constants can be found in the /Prc/Include/PrcDefines.h file.
Flag Type | Identifier | Value | Description |
---|---|---|---|
Entity Show Flag | PRC_GRAPHICS_Show | 0x0001 | Determines whether the entity is shown. |
PRC_GRAPHICS_SonHeritShow | 0x0002 | Son inheritance flag. | |
PRC_GRAPHICS_FatherHeritShow | 0x0004 | Parent inheritance flag. | |
Color/material Flag | PRC_GRAPHICS_SonHeritColor | 0x0008 | Determines son inheritance for color or material. |
PRC_GRAPHICS_FatherHeritColor | 0x0010 | Determines parent inheritance for color or material. | |
Layer Flag | PRC_GRAPHICS_SonHeritLayer | 0x0020 | Determines son inheritance for layers. |
PRC_GRAPHICS_FatherHeritLayer | 0x0040 | Determines parent inheritance for layers. | |
Transparency Flag | PRC_GRAPHICS_SonHeritTransparency | 0x0080 | Determines son inheritance for transparency. |
PRC_GRAPHICS_FatherHeritTransparency | 0x0100 | Determines parent inheritance for transparency. | |
Line Pattern Flag | PRC_GRAPHICS_SonHeritLinePattern | 0x0200 | Determines son inheritance for line patterns. |
PRC_GRAPHICS_FatherHeritLinePattern | 0x0400 | Determines parent inheritance for line patterns. | |
Line Width Flag | PRC_GRAPHICS_SonHeritLineWidth | 0x0800 | Determines son inheritance for line width. |
PRC_GRAPHICS_FatherHeritLineWidth | 0x1000 | Determines parent inheritance for line width. | |
Is Entity Removed Flag | PRC_GRAPHICS_Removed | 0x2000 | Determines whether the entity has been removed and does not appear in the tree. |
Assume that in the first case the entity behavior type is named kUseSon, and in the second case is named kUseParent. The third variant is kUseCurrent, which is the same as kUseParent.
Behavior settings are represented as a set of bits either for the entity (sonBits) or for its parent (fatherBits), therefore in general the algorithm of determining an entity behavior type consists of the following steps:
The first three bits of the behavior bit field are responsible for resolving the visibility of each entity. Examples below show how visibility of each entity is resolved when these bits have different values.
Entity | Parent Inherit | Son Inherit | Show Bit Value | Show Flags | Is Entity Shown | ||
---|---|---|---|---|---|---|---|
Product Occurrence | 0 | 0 | 1 | 0x01 | |||
Part Definition | 0 | 0 | 1 | 0x01 | |||
PolyBrepModel_1 | 0 | 0 | 1 | 0x01 | Yes | ||
PolyBrepModel_2 | 0 | 0 | 1 | 0x01 | Yes | ||
PolyBrepModel_3 | 0 | 0 | 1 | 0x01 | Yes |
All entities have the PRC_GRAPHICS_Show bit set, therefore they all will be shown.
Entity | Parent Inherit | Son Inherit | Show Bit Value | Show Flags | Is Entity Shown | ||
---|---|---|---|---|---|---|---|
Product Occurrence | 0 | 0 | 1 | 0x01 | |||
Part Definition | 0 | 0 | 0 | 0x00 | Yes | ||
PolyBrepModel_1 | 0 | 0 | 1 | 0x01 | Yes | ||
PolyBrepModel_2 | 0 | 0 | 0 | 0x00 | No | ||
PolyBrepModel_3 | 0 | 0 | 1 | 0x01 | Yes |
All entities are shown, except PolyBrepModel_2. Notice that despite PRC_GRAPHICS_Show not being set for Part Definition, child entities are shown anyway.
Entity | Parent Inherit | Son Inherit | Show Bit Value | Show Flags | Is Entity Shown | ||
---|---|---|---|---|---|---|---|
Product Occurrence | 0 or 1 | 1 or 0 | 0 | 0x02 (or 0x04) | |||
Part Definition | 0 | 0 | 0 | 0x00 | |||
PolyBrepModel_1 | 0 | 0 | 1 | 0x01 | No | ||
PolyBrepModel_2 | 0 | 0 | 0 | 0x00 | No | ||
PolyBrepModel_3 | 0 | 0 | 1 | 0x01 | No |
No entity is visible. Product Occurrence has the PRC_GRAPHICS_Show bit not set, and this value is inherited by other child entities.
Entity | Parent Inherit | Son Inherit | Show Bit Value | Show Flags | Is Entity Shown | ||
---|---|---|---|---|---|---|---|
Product Occurrence | 0 or 1 | 1 or 0 | 1 | 0x03 (or 0x05) | |||
Part Definition | 0 | 0 | 0 | 0x00 | |||
PolyBrepModel_1 | 0 | 0 | 1 | 0x01 | Yes | ||
PolyBrepModel_2 | 0 | 0 | 0 | 0x00 | No for Adobe 9.1, Yes for Adobe 11 | ||
PolyBrepModel_3 | 0 | 0 | 1 | 0x01 | Yes |
All entities will be shown, except PolyBrepModel_2. The PRC_GRAPHICS_Show bit value is inherited by all child entities, but the local show bit value also will be applied by the && operation.
Entity | Parent Inherit | Son Inherit | Show Bit Value | Show Flags | Is Entity Shown | ||
---|---|---|---|---|---|---|---|
Product Occurrence | 0 or 1 | 1 or 0 | 1 | 0x03 (or 0x05) | |||
Part Definition | 1 | 0 | 0 | 0x04 | |||
PolyBrepModel_1 | 0 | 0 | 1 | 0x01 | Yes | ||
PolyBrepModel_2 | 0 | 0 | 0 | 0x00 | No for Adobe 9.1, Yes for Adobe 11 | ||
PolyBrepModel_3 | 0 | 0 | 1 | 0x01 | Yes |
All entities are shown, except PolyBrepModel_2. PRC_GRAPHICS_FatherHeritShow can not override anything, even itself.
Entity | Parent Inherit | Son Inherit | Show Bit Value | Show Flags | Is Entity Shown | ||
---|---|---|---|---|---|---|---|
Product Occurrence | 0 or 1 | 1 or 0 | 1 | 0x03 (or 0x05) | |||
Part Definition | 0 | 1 | 0 | 0x02 | |||
PolyBrepModel_1 | 0 | 0 | 1 | 0x01 | No | ||
PolyBrepModel_2 | 0 | 0 | 0 | 0x00 | No | ||
PolyBrepModel_3 | 0 | 0 | 1 | 0x01 | No |
No entity is visible because PRC_GRAPHICS_SonHeritShow overrides other settings.
For example, if an OdPrcReference object points to a PolyBrepModel_3 entity and has (PRC_GRAPHICS_SonHeritShow | PRC_GRAPHICS_Show == 3) bits, then PolyBrepModel_3 is shown:
Entity | Parent Inherit | Son Inherit | Show Bit Value | Show Flags | Is Entity Shown | ||
---|---|---|---|---|---|---|---|
Product Occurrence | 0 or 1 | 1 or 0 | 1 | 0x03 (or 0x05) | |||
Part Definition | 0 | 1 | 0 | 0x02 | |||
PolyBrepModel_1 | 0 | 0 | 1 | 0x01 | No | ||
PolyBrepModel_2 | 0 | 0 | 0 | 0x00 | No | ||
PolyBrepModel_3 | Any | Any | Any | Any value | Yes |
For example, if OdPrcTessFace::behavior is set to PRC_GRAPHICS_SonHeritColor for all OdPrcTessFace objects in a file, all entities will be drawn in the color that OdPrcTessFace line attributes contain. But if OdPrcTessFace::behavior is set to the PRC_GRAPHICS_SonHeritShow bit without the PRC_GRAPHICS_Show bit, it does not disable entity visibility because the Show property bit is not filtered on this level.
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|