C3D Toolkit
Kernel - 117969, Vision - 2.8.1.4
|
Registrator of copied objects. More...
#include <item_registrator.h>
Public Member Functions | |
MbRegDuplicate () | |
Constructor. | |
virtual | ~MbRegDuplicate () |
Destructor. | |
virtual bool | IsReg (const MbRefItem *srcItem, MbRefItem *&cpyItem)=0 |
Check whether copy of the object is registered. More... | |
virtual void | SetReg (const MbRefItem *srcItem, MbRefItem *cpyItem)=0 |
Register copy of the object. More... | |
virtual MbRefItem * | SetRegCheck (const MbRefItem *srcItem, MbRefItem *&cpyItem)=0 |
Register a copy of the object with verification of the presence of already registered copy. More... | |
virtual void | Free ()=0 |
Free memory and remove itself. | |
Registrator of copied objects.
Registrator is used to construct the correct copies of objects. which contain pointers to other geometries.
Object pointer can be contained in several other objects for copying. Registrar is used to prevent multiple copying of the object. Registrator consists of two synchronous arrays. The first array contains pointers to copied objects, the second array contains pointers to their copies.
When copying the object using the registrator, the existence of the copied object inside the first array is verified. If such object exists, then the pointer to its copy is given from the second array. If such objects is absent, then it is stored in the first array, after that its copy is stored in the second array and then this copy is returned.
Check whether copy of the object is registered.
Find a registered copy of the object.
[in] | srcItem | - The initial object. |
[out] | cpyItem | - Registered copy of the object. |
Register copy of the object.
Register copy of the object.
[in] | srcItem | - The initial object. |
[out] | cpyItem | - The object copy. |
|
pure virtual |
Register a copy of the object with verification of the presence of already registered copy.
Register a copy of the object with verification of the presence of already registered copy. If a registered copy of the object already exists, then the input copy is not registered and deleted. The function returns a registered copy of the object.
[in] | srcItem | - The initial object. |
[in/out] | cpyItem - The object copy. Deleted if a registered copy already exists. |