Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-09 09:17:27

0001 // Created on: 2000-09-08
0002 // Created by: data exchange team
0003 // Copyright (c) 2000-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 _XCAFDoc_Centroid_HeaderFile
0017 #define _XCAFDoc_Centroid_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 
0021 #include <gp_Pnt.hxx>
0022 #include <TDF_Attribute.hxx>
0023 #include <Standard_Boolean.hxx>
0024 #include <Standard_OStream.hxx>
0025 class Standard_GUID;
0026 class TDF_Label;
0027 class TDF_RelocationTable;
0028 
0029 class XCAFDoc_Centroid;
0030 DEFINE_STANDARD_HANDLE(XCAFDoc_Centroid, TDF_Attribute)
0031 
0032 //! attribute to store centroid
0033 class XCAFDoc_Centroid : public TDF_Attribute
0034 {
0035 
0036 public:
0037   //! class methods
0038   //! =============
0039   Standard_EXPORT XCAFDoc_Centroid();
0040 
0041   Standard_EXPORT static const Standard_GUID& GetID();
0042 
0043   //! Find, or create, a Location attribute and set it's value
0044   //! the Location attribute is returned.
0045   //! Location methods
0046   //! ===============
0047   Standard_EXPORT static Handle(XCAFDoc_Centroid) Set(const TDF_Label& label, const gp_Pnt& pnt);
0048 
0049   Standard_EXPORT void Set(const gp_Pnt& pnt);
0050 
0051   Standard_EXPORT gp_Pnt Get() const;
0052 
0053   //! Returns point as argument
0054   //! returns false if no such attribute at the <label>
0055   Standard_EXPORT static Standard_Boolean Get(const TDF_Label& label, gp_Pnt& pnt);
0056 
0057   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
0058 
0059   Standard_EXPORT void Restore(const Handle(TDF_Attribute)& With) Standard_OVERRIDE;
0060 
0061   Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
0062 
0063   Standard_EXPORT void Paste(const Handle(TDF_Attribute)&       Into,
0064                              const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
0065 
0066   Standard_EXPORT virtual Standard_OStream& Dump(Standard_OStream& anOS) const Standard_OVERRIDE;
0067 
0068   //! Dumps the content of me into the stream
0069   Standard_EXPORT virtual void DumpJson(Standard_OStream& theOStream,
0070                                         Standard_Integer  theDepth = -1) const Standard_OVERRIDE;
0071 
0072   DEFINE_STANDARD_RTTIEXT(XCAFDoc_Centroid, TDF_Attribute)
0073 
0074 protected:
0075 private:
0076   gp_Pnt myCentroid;
0077 };
0078 
0079 #endif // _XCAFDoc_Centroid_HeaderFile