1 // Copyright (c) 2015 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #include <StdPersistent_DataXtd_Constraint.hxx>
16 #include <TNaming_NamedShape.hxx>
17 #include <TDataStd_Real.hxx>
20 //=======================================================================
22 //purpose : Import transient attribuite from the persistent data
23 //=======================================================================
24 void StdPersistent_DataXtd_Constraint::Import
25 (const Handle(TDataXtd_Constraint)& theAttribute) const
27 theAttribute->SetType (myType);
28 theAttribute->Reversed (myIsReversed);
29 theAttribute->Inverted (myIsInverted);
30 theAttribute->Verified (myIsVerified);
34 Handle(StdLPersistent_HArray1OfPersistent) aGeometries = myGeometries->Array();
35 for (Standard_Integer i = 1; i <= aGeometries->Length(); i++)
37 Handle(StdObjMgt_Persistent) aPGeometry = aGeometries->Value(i);
40 Handle(TDF_Attribute) aTGeometry = aPGeometry->GetAttribute();
41 theAttribute->SetGeometry
42 (i, Handle(TNaming_NamedShape)::DownCast (aTGeometry));
49 Handle(TDF_Attribute) aValue = myValue->GetAttribute();
50 theAttribute->SetValue (Handle(TDataStd_Real)::DownCast (aValue));
55 Handle(TDF_Attribute) aPlane = myPlane->GetAttribute();
56 theAttribute->SetPlane (Handle(TNaming_NamedShape)::DownCast (aPlane));