Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:20

0001 // Created on: 2009-04-06
0002 // Created by: Sergey ZARITCHNY
0003 // Copyright (c) 2009-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _TDataXtd_Position_HeaderFile
0017 #define _TDataXtd_Position_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021 
0022 #include <gp_Pnt.hxx>
0023 #include <TDF_Attribute.hxx>
0024 class TDF_Label;
0025 class Standard_GUID;
0026 class TDF_RelocationTable;
0027 
0028 
0029 class TDataXtd_Position;
0030 DEFINE_STANDARD_HANDLE(TDataXtd_Position, TDF_Attribute)
0031 
0032 //! Position of a Label
0033 class TDataXtd_Position : public TDF_Attribute
0034 {
0035 
0036 public:
0037 
0038   
0039   //! Create if not found the TDataXtd_Position attribute set its position to <aPos>
0040   Standard_EXPORT static void Set (const TDF_Label& aLabel, const gp_Pnt& aPos);
0041   
0042   //! Find an existing, or create an empty, Position.
0043   //! the Position attribute is returned.
0044   Standard_EXPORT static Handle(TDataXtd_Position) Set (const TDF_Label& aLabel);
0045   
0046   //! Search label <aLabel) for the TDataXtd_Position attribute and get its position
0047   //! if found returns True
0048   Standard_EXPORT static Standard_Boolean Get (const TDF_Label& aLabel, gp_Pnt& aPos);
0049   
0050   Standard_EXPORT TDataXtd_Position();
0051   
0052   //! Returns the ID of the attribute.
0053   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
0054   
0055   //! Returns the ID of the attribute.
0056   Standard_EXPORT static const Standard_GUID& GetID();
0057   
0058   //! Restores the contents from <anAttribute> into this
0059   //! one. It is used when aborting a transaction.
0060   Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& anAttribute) Standard_OVERRIDE;
0061   
0062   //! Returns an new empty attribute from the good end
0063   //! type. It is used by the copy algorithm.
0064   Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
0065   
0066   //! This method is different from the "Copy" one,
0067   //! because it is used when copying an attribute from
0068   //! a source structure into a target structure. This
0069   //! method pastes the current attribute to the label
0070   //! corresponding to the insertor. The pasted
0071   //! attribute may be a brand new one or a new version
0072   //! of the previous one.
0073   Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& intoAttribute, const Handle(TDF_RelocationTable)& aRelocTationable) const Standard_OVERRIDE;
0074   
0075   Standard_EXPORT const gp_Pnt& GetPosition() const;
0076   
0077   Standard_EXPORT void SetPosition (const gp_Pnt& aPos);
0078 
0079 
0080 
0081 
0082   DEFINE_STANDARD_RTTIEXT(TDataXtd_Position,TDF_Attribute)
0083 
0084 protected:
0085 
0086 
0087 
0088 
0089 private:
0090 
0091 
0092   gp_Pnt myPosition;
0093 
0094 
0095 };
0096 
0097 
0098 
0099 
0100 
0101 
0102 
0103 #endif // _TDataXtd_Position_HeaderFile