This article considers the question of using markup linked items in ODA PRC SDK.
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.
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:
const OdPrcReferenceData& referenceData() const;
OdPrcReferenceData& referenceData();
These methods are inherited from the OdPrcContentEntityReference
.
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:
bool leaderDeleteControl() const;
void setLeaderDeleteControl(bool leader_delete_control);
bool leaderShowControl() const;
void setLeaderShowControl(bool leader_show_control);
bool markupDeleteControl() const;
void setMarkupDeleteControl(bool markup_delete_control);
bool markupShowControl() const;
void setMarkupShowControl(bool markup_show_control);
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();
const OdPrcObjectIdArray& linkedItem() const;
OdPrcObjectIdArray& linkedItem();
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.
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:
When switched to the view described at the previous illustration, you will see the following:
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|