mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026961: Recover possibility to read files in old persistence format
Possibility to read shapes and OCAF documents from old persistence format (Std and StdL schema) is restored. Test cases used old persistent files on input are restored with suffix "_std" Removing toolkit from OS package
This commit is contained in:
52
src/StdPersistent/StdPersistent_TopLoc.cxx
Normal file
52
src/StdPersistent/StdPersistent_TopLoc.cxx
Normal file
@@ -0,0 +1,52 @@
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <StdPersistent_TopLoc.hxx>
|
||||
#include <StdObjMgt_ReadData.hxx>
|
||||
#include <StdObject_gp.hxx>
|
||||
|
||||
#include <gp_Trsf.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Read
|
||||
//purpose : Read persistent data from a file
|
||||
//=======================================================================
|
||||
void StdPersistent_TopLoc::Datum3D::Read (StdObjMgt_ReadData& theReadData)
|
||||
{
|
||||
StdObject_gp::Object<gp_Trsf> aTrsf;
|
||||
theReadData >> aTrsf;
|
||||
myTransient = new TopLoc_Datum3D (aTrsf);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Read
|
||||
//purpose : Read persistent data from a file
|
||||
//=======================================================================
|
||||
void StdPersistent_TopLoc::ItemLocation::Read (StdObjMgt_ReadData& theReadData)
|
||||
{
|
||||
theReadData >> myDatum >> myPower >> myNext;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Import
|
||||
//purpose : Import transient object from the persistent data
|
||||
//=======================================================================
|
||||
TopLoc_Location StdPersistent_TopLoc::ItemLocation::Import() const
|
||||
{
|
||||
TopLoc_Location aNext = myNext.Import();
|
||||
if (myDatum)
|
||||
return aNext * TopLoc_Location (myDatum->Import()).Powered (myPower);
|
||||
else
|
||||
return aNext;
|
||||
}
|
Reference in New Issue
Block a user