0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / src / StdObject / StdObject_Location.hxx
CommitLineData
7ed7467d 1// Copyright (c) 2015 OPEN CASCADE SAS
2//
3// This file is part of Open CASCADE Technology software library.
4//
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.
10//
11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
13
14
ff205346 15#ifndef _StdObject_Location_HeaderFile
16#define _StdObject_Location_HeaderFile
7ed7467d 17
45d8465e 18#include <StdObjMgt_ReadData.hxx>
ec964372 19#include <StdObjMgt_WriteData.hxx>
20#include <StdObjMgt_Persistent.hxx>
21#include <StdObjMgt_TransientPersistentMap.hxx>
7ed7467d 22
ff205346 23#include <TopLoc_Location.hxx>
7ed7467d 24
45d8465e 25class StdObject_Location
7ed7467d 26{
27public:
ec964372 28
29 //! Gets persistent child objects
30 Standard_EXPORT void PChildren(StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const;
31
ff205346 32 //! Import transient object from the persistent data.
33 TopLoc_Location Import() const;
7ed7467d 34
ec964372 35 //! Creates a persistent wrapper object for a location
36 Standard_EXPORT static StdObject_Location Translate (const TopLoc_Location& theLoc,
37 StdObjMgt_TransientPersistentMap& theMap);
38
7ed7467d 39private:
45d8465e 40 Handle(StdObjMgt_Persistent) myData;
41
42 friend StdObjMgt_ReadData& operator >>
472433e2 43 (StdObjMgt_ReadData&, StdObject_Location&);
ec964372 44 friend StdObjMgt_WriteData& operator <<
472433e2 45 (StdObjMgt_WriteData&, const StdObject_Location&);
7ed7467d 46};
47
45d8465e 48//! Read persistent data from a file.
49inline StdObjMgt_ReadData& operator >>
472433e2 50 (StdObjMgt_ReadData& theReadData, StdObject_Location& theLocation)
45d8465e 51{
472433e2 52 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
45d8465e 53 return theReadData >> theLocation.myData;
54}
55
ec964372 56//! Write persistent data to a file.
57inline StdObjMgt_WriteData& operator <<
472433e2 58 (StdObjMgt_WriteData& theWriteData, const StdObject_Location& theLocation)
ec964372 59{
472433e2 60 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
ec964372 61 return theWriteData << theLocation.myData;
62}
63
7ed7467d 64#endif