Entity Base with Graphics

Types

A3DRootBaseWithGraphicsData

Functions

A3DStatus

A3DRootBaseWithGraphicsGet

A3DStatus

A3DRootBaseWithGraphicsSet

Detailed Description

group a3d_rootbasewithgraphics

Creates and accesses global graphic characteristics that apply to any PRC entity in the Graphics.

Entity type is kA3DTypeRootBaseWithGraphics.

Version

11.1

Any PRC entity that bears graphics can have an A3DRootBaseWithGraphics entity.

The A3DRootBaseWithGraphics entity references graphic attributes such as line patterns, RGB colors, and textures. Those graphic attributes are used in the more specific PRC entity.

See also

a3d_graphics

Function Documentation

A3DStatus A3DRootBaseWithGraphicsGet(const A3DRootBaseWithGraphics *pRoot, A3DRootBaseWithGraphicsData *pData)

Populates the A3DRootBaseWithGraphicsData structure.

Version

11.1

Return values:
  • A3D_INITIALIZE_NOT_CALLED

  • A3D_INVALID_DATA_STRUCT_SIZE

  • A3D_INVALID_DATA_STRUCT_NULL

  • A3D_INVALID_ENTITY_NULL

  • A3D_INVALID_ENTITY_TYPE

  • A3D_SUCCESS

Returns:

A3D_SUCCESS on success, or an error code on failure

A3DStatus A3DRootBaseWithGraphicsSet(A3DRootBaseWithGraphics *pRoot, const A3DRootBaseWithGraphicsData *pData)

Adds an A3DRootBaseWithGraphicsData structure to an existing A3DRootBaseWithGraphics entity.

Version

11.1

Note

The A3DRootBaseWithGraphics entity type is an abstract class and cannot be directly created; however, any graphic entity created with a function of the form A3DCreate results in the creation of a PRC entity of type A3DRootBaseWithGraphics and of type A3D. That is, a function of the form A3DCreate adds specific data to the base class, for example A3DRootBaseWithGraphicsData::m_pGraphics.

Note

When A3DRootBaseWithGraphicsSet is used to set a new A3DGraphics, its data is copied in the A3DRootBaseWithGraphics but the pointer is not kept nor freed later when the A3DRootBaseWithGraphics is deleted. It must be deleted using A3DGraphicsDelete

A3DGraphicsData sGraphicsData;
A3D_INITIALIZE_DATA(A3DGraphicsData, sGraphicsData)
// fill in sGraphicsData

A3DGraphics* pGraphics = NULL;
A3DStatus    eStatus   = A3DGraphicsCreate(&sGraphicsData, &graphics);

A3DRootBaseWithGraphicsData sRootBaseWithGraphicsData;
A3D_INITIALIZE_DATA(A3DRootBaseWithGraphicsData, sRootBaseWithGraphicsData)
sRootBaseWithGraphicsData.m_pGraphics = pGraphics;

// copy pGraphics'content to pEntity
eStatus = A3DRootBaseWithGraphicsSet(pEntity, &sRootBaseWithGraphicsData);

// free pGraphics
eStatus = A3DGraphicsDelete(pGraphics);
Never call A3DGraphicsDelete on an A3DGraphics obtained with A3DRootBaseWithGraphicsGet.

Return values:
  • A3D_INVALID_DATA_STRUCT_SIZE

  • A3D_INVALID_DATA_STRUCT_NULL

  • A3D_SUCCESS

Returns:

A3D_SUCCESS on success, or an error code on failure