0025545: TopLoc_Location::Transformation() provokes data races
[occt.git] / src / TopLoc / TopLoc_SListOfItemLocation.cxx
CommitLineData
b311480e 1// Created on: 1993-02-26
2// Created by: Remi LEQUETTE
3// Copyright (c) 1993-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
bd2de396 17#include <TopLoc_SListOfItemLocation.ixx>
18
7fd59977 19#include <Standard_NoSuchObject.hxx>
20
21//=======================================================================
bd2de396 22//function : TopLoc_SListOfItemLocation
7fd59977 23//purpose :
24//=======================================================================
25
bd2de396 26TopLoc_SListOfItemLocation::TopLoc_SListOfItemLocation(const TopLoc_ItemLocation& anItem,
27 const TopLoc_SListOfItemLocation& aTail) :
28 myNode(new TopLoc_SListNodeOfItemLocation(anItem,aTail))
7fd59977 29{
ee6bb37b 30 if (!myNode->Tail().IsEmpty()) {
31 const gp_Trsf& aT = myNode->Tail().Value().myTrsf;
32 myNode->Value().myTrsf.PreMultiply (aT);
33 }
7fd59977 34}
35
36//=======================================================================
37//function : Assign
38//purpose :
39//=======================================================================
40
bd2de396 41TopLoc_SListOfItemLocation& TopLoc_SListOfItemLocation::Assign(const TopLoc_SListOfItemLocation& Other)
7fd59977 42{
43 if (this == &Other) return *this;
44 Clear();
45 myNode = Other.myNode;
46
47 return *this;
48}
49
50//=======================================================================
7fd59977 51//function : Value
52//purpose :
53//=======================================================================
54
bd2de396 55const TopLoc_ItemLocation& TopLoc_SListOfItemLocation::Value() const
7fd59977 56{
bd2de396 57 Standard_NoSuchObject_Raise_if(myNode.IsNull(),"TopLoc_SListOfItemLocation::Value");
7fd59977 58 return myNode->Value();
59}
60
61//=======================================================================
7fd59977 62//function : Tail
63//purpose :
64//=======================================================================
65
bd2de396 66const TopLoc_SListOfItemLocation& TopLoc_SListOfItemLocation::Tail() const
7fd59977 67{
68 if (!myNode.IsNull())
69 return myNode->Tail();
70 else
71 return *this;
72}