Close

Relief for ODA Team in Ukraine

Learn more
ODA PRC SDK
Overview of Markup Tessellation

A markup tessellation is the tessellation data related to a markup. Markup tessellation is implemented with the OdPrcMarkupTess class.

Two arrays represent markup tessellation data:

  • Array of codes which specifies the type of tessellation entities.
    To get access to the tessellation codes array, use the codes() method of the OdPrcMarkupTess class.
  • Array of point coordinates and other double data.
    To get access to the tessellation coordinates array, use the coordinates() method.

Each markup tessellation entity is defined with two codes:

  1. Entity type code + number of additional codes.
  2. Number of double values in the coordinates array.

Since the first code of a markup tessellation entity has a complex structure, several bit masks can be used to extract separate values from it. These masks are defined in the /Prc/Include/PrcDefines.h file.

Identifier Value Description
PRC_MARKUP_IsMatrix 0x08000000 Specifies the current entity as a matrix.
PRC_MARKUP_IsExtraData 0x04000000 Specifies the current entity as extra data.
PRC_MARKUP_IntegerMask 0x000FFFFF Determines the number of additional codes.
PRC_MARKUP_ExtraDataType 0x03E00000 Specifies the type of extra data entity.

If no mask is set, the markup tessellation entity is a polyline (0x00000000). The table below represents the full list of markup tessellation entities.

Entity Entity Type Code Number of Additional Codes Size of Coordinates Array Description
Polyline 0x00000000 0 Number of points * 3 Coordinates of each polyline point are stored.
Triangles 0x04400000 0 Number of triangles * 9 Coordinates of each triangle vertex are stored.
Quads 0x04600000 0 Number of quads * 12 Coordinates of each quad vertex are stored.
Polygon 0x06000000 0 Number of points * 3 Coordinates of each polygon point are stored.
Points 0x05e00000 0 Number of points * 3 Coordinates of each point are stored.
Face View Mode 0x04c00000 0 or number of entities in block 0 or number of doubles in block All the rendered entities are parallel to the screen. Coordinates array contains coordinates of the origin point of the new coordinate system in which entities are rendered parallel to the screen.
Frame Draw Mode 0x04e00000 0 or number of entities in block 0 or number of doubles in block All entities are rendered in a 2D plane. The point coordinates are 3D point coordinates projected onto the screen (viewport).
Fixed Size Mode 0x05000000 0 or number of entities in block 0 or number of doubles in block All entities are rendered with a fixed size. The point coordinates correspond to the origin of the new coordinate system in which entities are rendered with a fixed size.
Matrix Mode 0x08000000 0 or number of entities in block 0 or number of doubles in block All the rendering entities are transformed by the matrix stored in the coordinates array and multiplied by the current transformation matrix. The previously active transformation matrix is restored at the end of the matrix mode.
Symbol 0x05200001 1 3 The point coordinates store the 3D symbol position. The pattern identifier is an index of an element in the picture array, which is stored in internal global data of the file structure.
Color 0x05600001 1 0 Contains a color, which is applied until a new color is defined. The second code contains an index of the color array element. The color array is stored in internal global data of the file structure.
Font 0x05a00001 1 0 Contains a font used for the text entity. The second code contains an index of the font array element. The font array is stored in internal global data of the file structure.
Text 0x05c00001 1 2 Entity contains text to be drawn with the current color and font. The second code contains an index of the markup strings array. The text index refers to the text number in the string array. Two double values store text width and height.
Line Width Mode 0x06200000 1 2 This entity defines the line width inside the block.
Cylinder 0x05400000 0 3 Cylinder entity is positioned by a matrix mode, oriented with the z-axis, with the base at z = 0 and the top at Z = Height.
Picture 0x04020000 1 0 Entity contains a picture. The second code contains an index of the picture array element. The picture array is stored in internal global data of the file structure.
Pattern 0x04000000 3 + Number of loops Points in loops * 3 The pattern identifier is an index of an element of the fill pattern array. This array is stored in internal global data of the file structure.
The behavior is a bit field. Bit value 0x1 means that the pattern is not transformed by the current view transformation. The other bits should be set to zero.
Each loop point is stored in the coordinates array in sequential order.

In addition to codes and coordinates arrays, a markup tessellation object contains:

  • Text strings — Stores strings used by text entities (text() method).
  • Label — Contains the name of the related markup entity (label() and setLabel() methods).
  • Behavior bits — Determines graphical behavior of the tessellation (behaviour() and setBehaviour() methods):
    Identifier Value Description
    PRC_MARKUP_IsHidden 0x01 Markup tessellation is not visible.
    PRC_MARKUP_HasFrame 0x02 Markup tessellation is bounded with a frame.
    PRC_MARKUP_IsNotModifiable 0x04 Markup tessellation cannot be modified.
    PRC_MARKUP_IsZoomable 0x08 Markup tessellation can be zoomed in an out.
    PRC_MARKUP_IsOnTop 0x10 Markup tessellation is on top of the geometry.
    PRC_MARKUP_IsFlipable 0x20 Markup tessellation is flippable. Currently is not used.

Markup Tessellation Interface Classes

Instead of working with markup tessellations by editing codes and coordinates arrays, ODA PRC SDK provides an interface based on a markup tessellation buffer class (OdPrcMarkupTessBuf).

A markup tessellation buffer is a single-linked list of objects that determines the markup tessellation and encapsulates all low-level functionality (working with code and coordinate arrays). A markup tessellation buffer consists of one or more objects derived from the OdPrcMarkupTessBuff class and is represented with a smart pointer to an OdPrcMarkupTessBuf object, which is the head of the list.

To iterate to the next entity in the tessellation buffer, use the next() method. To add a new element in the list, use the setNext() method.

A set of markup tessellation buffer classes is derived from OdPrcMarkupTessBuf:

Class Description
OdPrcMarkupTessBufBlock A block of tessellation entities.
OdPrcMarkupTessBufPolyline Represents a polyline in a tessellation.
OdPrcMarkupTessBufMatrix Represents a matrix in a tessellation.
OdPrcMarkupTessBufTriangles Represents triangles in a tessellation.
OdPrcMarkupTessBufFrame Represents a frame in a tessellation.
OdPrcMarkupTessBufFixedSize Represents a fixed-sized entity in a tessellation.
OdPrcMarkupTessBufSymbol Represents a symbol in a tessellation.
OdPrcMarkupTessBufCylinder Represents a cylinder in a tessellation.
OdPrcMarkupTessBufColor Represents a color in a tessellation.
OdPrcMarkupTessBufFont Represents a font in a tessellation.
OdPrcMarkupTessBufText Represents a text entity in a tessellation.
OdPrcMarkupTessBufPoints Represents a set of points in a tessellation.
OdPrcMarkupTessBufPolygon Represents a polygon in a tessellation.

To add an entity to a markup tessellation, create an object of any type listed above and add it to the list.

When the list of tessellation objects is created, it should be passed to the setFromOdPrcMarkupTessBuf() method of an OdPrcMarkupTess object to create the markup tessellation.

To get the markup tessellation buffer for a specified file structure, call the getOdPrcMarkupTessBuf() method of the OdPrcMarkupTess class.

See Also

Create a Markup Tessellation
Work with Markup Tessellation
Copyright © 2002 – 2022. Open Design Alliance. All rights reserved.