0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / TDataXtd / TDataXtd_Position.hxx
CommitLineData
42cf5bc1 1// Created on: 2009-04-06
2// Created by: Sergey ZARITCHNY
3// Copyright (c) 2009-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
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.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _TDataXtd_Position_HeaderFile
17#define _TDataXtd_Position_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_Type.hxx>
21
22#include <gp_Pnt.hxx>
23#include <TDF_Attribute.hxx>
24#include <Standard_Boolean.hxx>
25class TDF_Label;
26class gp_Pnt;
27class Standard_GUID;
28class TDF_Attribute;
29class TDF_RelocationTable;
30
31
32class TDataXtd_Position;
33DEFINE_STANDARD_HANDLE(TDataXtd_Position, TDF_Attribute)
34
35//! Position of a Label
36class TDataXtd_Position : public TDF_Attribute
37{
38
39public:
40
41
42 //! Create if not found the TDataXtd_Position attribute set its position to <aPos>
43 Standard_EXPORT static void Set (const TDF_Label& aLabel, const gp_Pnt& aPos);
44
45 //! Find an existing, or create an empty, Position.
46 //! the Position attribute is returned.
47 Standard_EXPORT static Handle(TDataXtd_Position) Set (const TDF_Label& aLabel);
48
49 //! Search label <aLabel) for the TDataXtd_Position attribute and get its position
50 //! if found returns True
51 Standard_EXPORT static Standard_Boolean Get (const TDF_Label& aLabel, gp_Pnt& aPos);
52
53 Standard_EXPORT TDataXtd_Position();
54
55 //! Returns the ID of the attribute.
56 Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
57
58 //! Returns the ID of the attribute.
59 Standard_EXPORT static const Standard_GUID& GetID();
60
61 //! Restores the contents from <anAttribute> into this
62 //! one. It is used when aborting a transaction.
63 Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& anAttribute) Standard_OVERRIDE;
64
65 //! Returns an new empty attribute from the good end
66 //! type. It is used by the copy algorithm.
67 Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
68
69 //! This method is different from the "Copy" one,
70 //! because it is used when copying an attribute from
71 //! a source structure into a target structure. This
72 //! method pastes the current attribute to the label
73 //! corresponding to the insertor. The pasted
74 //! attribute may be a brand new one or a new version
75 //! of the previous one.
76 Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& intoAttribute, const Handle(TDF_RelocationTable)& aRelocTationable) const Standard_OVERRIDE;
77
78 Standard_EXPORT const gp_Pnt& GetPosition() const;
79
80 Standard_EXPORT void SetPosition (const gp_Pnt& aPos);
81
82
83
84
92efcf78 85 DEFINE_STANDARD_RTTIEXT(TDataXtd_Position,TDF_Attribute)
42cf5bc1 86
87protected:
88
89
90
91
92private:
93
94
95 gp_Pnt myPosition;
96
97
98};
99
100
101
102
103
104
105
106#endif // _TDataXtd_Position_HeaderFile