mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-13 14:27:08 +03:00
0027241: Create a complete test case to verify reading of all attribute types from MDTV-Standard document
Added test case that works in one of two modes: 1) create synthetic document (in old version of OCCT) containing all possible attributes. 2) open the document and compare all attributes with expected values. Fixed reading of TDataStd_NamedData, TDataXtd_PatternStd, and PColStd_HArray2OfReal. Point and curve representations are created even from NULL geometry handles. The code is simplified by abandoning usage of templates from StdObjMgt_ContentTypes class for persistent data elements. Fixed SetAsciiString Draw command failed when the target label contained NamedData attribute.
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
#include <StdObjMgt_ReadData.hxx>
|
||||
#include <StdObjMgt_Persistent.hxx>
|
||||
|
||||
#include <Standard_GUID.hxx>
|
||||
|
||||
|
||||
StdObjMgt_ReadData::StdObjMgt_ReadData
|
||||
(Storage_BaseDriver& theDriver, const Standard_Integer theNumberOfObjects)
|
||||
@@ -39,3 +41,23 @@ Handle(StdObjMgt_Persistent) StdObjMgt_ReadData::ReadReference()
|
||||
myDriver->GetReference (aRef);
|
||||
return aRef ? PersistentObject (aRef) : NULL;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : operator >>
|
||||
//purpose : Read persistent data from a file
|
||||
//=======================================================================
|
||||
StdObjMgt_ReadData& operator >>
|
||||
(StdObjMgt_ReadData::Object theReadData, Standard_GUID& theGUID)
|
||||
{
|
||||
Standard_Integer a32b;
|
||||
Standard_ExtCharacter a16b[3];
|
||||
Standard_Character a8b [6];
|
||||
|
||||
theReadData >> a32b >> a16b[0] >> a16b[1] >> a16b[2];
|
||||
theReadData >> a8b[0] >> a8b[1] >> a8b[2] >> a8b[3] >> a8b[4] >> a8b[5];
|
||||
|
||||
theGUID = Standard_GUID (a32b, a16b[0], a16b[1], a16b[2],
|
||||
a8b[0], a8b[1], a8b[2], a8b[3], a8b[4], a8b[5]);
|
||||
|
||||
return theReadData;
|
||||
}
|
||||
|
Reference in New Issue
Block a user