Close

Relief for ODA Team in Ukraine

Learn more
ODA PRC SDK
Usage of Markup Linked Items

This article considers the question of using markup linked items in ODA PRC SDK.

What is Markup Linked Item?

A markup linked item represents a relation between a markup and a part of a product assembly in a .prc file. As a markup, a markup linked item can have a leader object.

Markup Linked Item Implementation in ODA PRC SDK

In ODA PRC SDK the markup linked item is implemented through the OdPrcMarkupLinkedItem class. An instance of OdPrcMarkupLinkedItem class acts like an instance of OdPrcReference class: like an OdPrcReference object, it can override the location, appearance and line style of the referenced entity (assembly part).

The difference between OdPrcMarkupLinkedItem and OdPrcReference is that OdPrcMarkupLinkedItem object can apply these overrides only through switching views (OdPrcView class instances).

Each OdPrcView object provide access to its own set of markup linked items through methods inherited from the OdPrcContentView class:


const OdPrcObjectIdArray& linkedItems() const;
OdPrcObjectIdArray& linkedItems();
    

These methods return an array of markup linked item identifiers: the first one only for reading, the second one for changing.

Thus, every OdPrcView object can change the rendering properties of entities using markup linked items.

An OdPrcMarkupLinkedItem object contains two links:

  • The first link refers to the entity for which graphic parameters are overridden. This link can be obtained for reading or changing though calling following methods:
    
    const OdPrcReferenceData& referenceData() const;
    OdPrcReferenceData& referenceData();
            

    These methods are inherited from the OdPrcContentEntityReference.

  • The second link refers to the tree part (product occurrence) object that contains the entity. This link can be retrieved for reading or changing through calling following methods:
    
    OdPrcReferenceData& referencedProductOccurrence();
    const OdPrcReferenceData& referencedProductOccurrence() const;
            

    For the current implementation, this link does not affect the rendering of the entity. These methods are inherited from the OdPrcContentExtendedEntityReference class.

Besides methods described above, ODA PRC API provides several methods for OdPrcMarkupLinkedItem class, which control the markup linked item behaviour:

  • Determine whether the markup leader is deleted when the referenced entity is deleted.
    
    bool leaderDeleteControl() const;
    void setLeaderDeleteControl(bool leader_delete_control);
            
  • Determine whether the markup leader is shown when the referenced entity is shown.
    
    bool leaderShowControl() const;
    void setLeaderShowControl(bool leader_show_control);        
            
  • Determine whether the markup object is deleted when the referenced entity is deleted:
    
    bool markupDeleteControl() const;
    void setMarkupDeleteControl(bool markup_delete_control);
            
  • Determine whether the markup object is shown when the referenced entity is shown:
    
    bool markupShowControl() const;
    void setMarkupShowControl(bool markup_show_control);
            

Getting an Access to Markup Linked Items

A set of OdPrcMarkupLinkedItem objects is stored in OdPrcProductOcurrence and can be accessed through using the following methods:

  • OdPrcProductOccurrence class methods, which return OdPrcMarkups class that stores identifiers for accessing annotations, markups, leaders and linked items:
    
    const OdPrcMarkups& markups() const;
    OdPrcMarkups& markups();
            
  • In its turn, the OdPrcMarkups class provides methods for accessing to the set of markup linked items represented with their identifiers:
    
    const OdPrcObjectIdArray& linkedItem() const;
    OdPrcObjectIdArray& linkedItem();
            

Getting and Setting Coordinate System and Graphical Parameters

Like any reference, markup linked item can include a coordinate system and graphical parameters, which are applied to the referenced assembly part.

To get an access to a new coordinate system use the following methods inherited from the OdPrcContentEntityReference class:


const OdPrcObjectId& localCoordinateSystem() const;
OdPrcObjectId& localCoordinateSystem();
    

These methods return the identifier of the local coordinate system for reading (the first method) or changing (the second method).

Graphical parameters, which should be applied to the referenced entity are available through the following methods inherited from the OdPrcBaseWithGraphics class (for reading and changing respectively):


const OdPrcGraphics& graphics() const;
OdPrcGraphics& graphics();
    

The graphical behavior of the OdPrcMarkupLinkedItem objects is similar to the behaviour of the OdPrcGraphics objects. Please see the Management of Graphical Entity Behavior for additional information.

Example of Using OdPrcMarkupLinkedItem Class

Assume that we have a .prc file with the default view like at the picture below:

At the next picture you can see the structure of another OdPrcView object, which we are going to switch. You can see a list of OdPrcMarkupLinkedItem items related with the view object (identifier = 283).

Also, at the picture you can see the OdPrcMarkupLinkedItem object (identifier = 24A) that overrides properties for the OdPrcProductOccurrence entity with identifier = 50:

  • Overridden line style is represented with an OdPrcCategory1LineStyle object with the identifier = 298.
  • Overridden coordinate system is represented with an OdPrcCoordinateSystem object with the identifier = 24B.
  • Overridden graphical behaviour bit field: 11 (it means PRC_GRAPHICS_Show | PRC_GRAPHICS_SonHeritShow | PRC_GRAPHICS_SonHeritColor).

When switched to the view described at the previous illustration, you will see the following:

See Also

Work with Representation Entities
Work with Markup Entities
Management of Graphical Entity Behavior
Copyright © 2002 – 2022. Open Design Alliance. All rights reserved.