1 // Created on: 2018/03/21
2 // Created by: Eugeny MALTCHIKOV
3 // Copyright (c) 2018 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <BRepTest_Objects.hxx>
18 //=======================================================================
19 //function : BRepTest_Session
20 //purpose : Class for the objects in the session
21 //=======================================================================
22 class BRepTest_Session
29 //! Sets the History in the session
30 void SetHistory(const Handle(BRepTools_History)& theHistory)
32 myHistory = theHistory;
35 //! Add the History to the history in the session
36 void AddHistory(const Handle(BRepTools_History)& theHistory)
38 if (myHistory.IsNull())
39 myHistory = new BRepTools_History;
40 myHistory->Merge(theHistory);
43 //! Returns the history from the session
44 const Handle(BRepTools_History)& History() const
51 Handle(BRepTools_History) myHistory;
54 //=======================================================================
55 //function : GetSession
57 //=======================================================================
58 static BRepTest_Session& GetSession()
60 static BRepTest_Session* pSession = new BRepTest_Session();
64 //=======================================================================
65 //function : SetHistory
67 //=======================================================================
68 void BRepTest_Objects::SetHistory(const Handle(BRepTools_History)& theHistory)
70 GetSession().SetHistory(theHistory);
73 //=======================================================================
74 //function : AddHistory
76 //=======================================================================
77 void BRepTest_Objects::AddHistory(const Handle(BRepTools_History)& theHistory)
79 GetSession().AddHistory(theHistory);
82 //=======================================================================
85 //=======================================================================
86 Handle(BRepTools_History) BRepTest_Objects::History()
88 return GetSession().History();