b311480e |
1 | // Created on: 2004-11-23 |
2 | // Created by: Pavel TELKOV |
973c2be1 |
3 | // Copyright (c) 2004-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
7fd59977 |
16 | // The original implementation Copyright: (C) RINA S.p.A |
17 | |
18 | #ifndef TObj_TXYZ_HeaderFile |
19 | #define TObj_TXYZ_HeaderFile |
20 | |
21 | #include <TObj_Common.hxx> |
22 | |
23 | #include <gp_XYZ.hxx> |
24 | #include <TDF_Attribute.hxx> |
25 | |
26 | |
7fd59977 |
27 | class Standard_GUID; |
28 | class TDF_Label; |
7fd59977 |
29 | |
30 | /* |
31 | * Attribute for storing gp_XYZ |
32 | */ |
33 | |
34 | class TObj_TXYZ : public TDF_Attribute |
35 | { |
36 | public: |
37 | //! Standard methods of OCAF attribute |
38 | |
39 | //! Empty constructor |
40 | Standard_EXPORT TObj_TXYZ(); |
41 | |
42 | //! This method is used in implementation of ID() |
43 | static Standard_EXPORT const Standard_GUID& GetID(); |
44 | |
45 | //! Returns the ID of TObj_TXYZ attribute. |
79104795 |
46 | Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE; |
7fd59977 |
47 | |
48 | public: |
49 | //! Method for create TObj_TXYZ object |
50 | |
51 | //! Creates attribute and sets the XYZ |
52 | static Standard_EXPORT Handle(TObj_TXYZ) Set (const TDF_Label& theLabel, |
53 | const gp_XYZ& theXYZ); |
54 | public: |
55 | //! Methods for setting and obtaining XYZ |
56 | |
57 | //! Sets the XYZ |
58 | Standard_EXPORT void Set(const gp_XYZ& theXYZ); |
59 | |
60 | //! Returns the XYZ |
61 | Standard_EXPORT gp_XYZ Get() const; |
62 | |
63 | public: |
64 | //! Redefined OCAF abstract methods |
65 | |
66 | //! Returns an new empty TObj_TXYZ attribute. It is used by the |
67 | //! copy algorithm. |
79104795 |
68 | Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; |
7fd59977 |
69 | |
70 | //! Restores the backuped contents from <theWith> into this one. It is used |
71 | //! when aborting a transaction. |
79104795 |
72 | Standard_EXPORT void Restore(const Handle(TDF_Attribute)& theWith) Standard_OVERRIDE; |
7fd59977 |
73 | |
74 | //! This method is used when copying an attribute from a source structure |
75 | //! into a target structure. |
76 | Standard_EXPORT void Paste(const Handle(TDF_Attribute)& theInto, |
79104795 |
77 | const Handle(TDF_RelocationTable)& theRT) const Standard_OVERRIDE; |
7fd59977 |
78 | |
79 | //! This method dumps the attribute value into the stream |
79104795 |
80 | Standard_EXPORT virtual Standard_OStream& Dump(Standard_OStream& theOS) const Standard_OVERRIDE; |
7fd59977 |
81 | |
82 | private: |
83 | //! Fields |
84 | gp_XYZ myXYZ; //!< The object interface stored by the attribute |
85 | |
86 | public: |
87 | //! CASCADE RTTI |
92efcf78 |
88 | DEFINE_STANDARD_RTTIEXT(TObj_TXYZ,TDF_Attribute) |
7fd59977 |
89 | }; |
90 | |
91 | //! Define handle class for TObj_TXYZ |
92 | DEFINE_STANDARD_HANDLE(TObj_TXYZ,TDF_Attribute) |
93 | |
94 | #endif |
95 | |
96 | #ifdef _MSC_VER |
97 | #pragma once |
98 | #endif |