Back to home page

EIC code displayed by LXR

 
 

    


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

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_Geometry_HeaderFile
0017 #define _TDataXtd_Geometry_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021 
0022 #include <TDataXtd_GeometryEnum.hxx>
0023 #include <TDF_Attribute.hxx>
0024 #include <Standard_OStream.hxx>
0025 class TDF_Label;
0026 class TNaming_NamedShape;
0027 class gp_Pnt;
0028 class gp_Ax1;
0029 class gp_Lin;
0030 class gp_Circ;
0031 class gp_Elips;
0032 class gp_Pln;
0033 class gp_Cylinder;
0034 class Standard_GUID;
0035 class TDF_RelocationTable;
0036 
0037 class TDataXtd_Geometry;
0038 DEFINE_STANDARD_HANDLE(TDataXtd_Geometry, TDF_Attribute)
0039 
0040 //! This class is used to model construction geometry.
0041 //! The specific geometric construction of the
0042 //! attribute is defined by an element of the
0043 //! enumeration TDataXtd_GeometryEnum.
0044 //! This attribute may  also be used to qualify  underlying
0045 //! geometry  of   the  associated NamedShape.     for
0046 //! Constructuion element by example.
0047 class TDataXtd_Geometry : public TDF_Attribute
0048 {
0049 
0050 public:
0051   //! API class methods
0052   //! =================
0053   //! Finds, or  creates, a Geometry attribute  defined by the label label.
0054   //! The default type of geometry is the value
0055   //! ANY_GEOM of the enumeration TDataXtd_GeometryEnum.
0056   //! To specify another value of this enumeration, use
0057   //! the function SetType.
0058   Standard_EXPORT static Handle(TDataXtd_Geometry) Set(const TDF_Label& label);
0059 
0060   //! Returns the label L used to define the type of
0061   //! geometric construction for the geometry attribute.
0062   Standard_EXPORT static TDataXtd_GeometryEnum Type(const TDF_Label& L);
0063 
0064   //! Returns the topological attribute S used to define
0065   //! the type of geometric construction for the geometry attribute.
0066   Standard_EXPORT static TDataXtd_GeometryEnum Type(const Handle(TNaming_NamedShape)& S);
0067 
0068   //! Returns the point attribute defined by the label L and the point G.
0069   Standard_EXPORT static Standard_Boolean Point(const TDF_Label& L, gp_Pnt& G);
0070 
0071   //! Returns the point attribute defined by the topological attribute S and the point G.
0072   Standard_EXPORT static Standard_Boolean Point(const Handle(TNaming_NamedShape)& S, gp_Pnt& G);
0073 
0074   //! Returns the axis attribute defined by the label L and the axis G.
0075   Standard_EXPORT static Standard_Boolean Axis(const TDF_Label& L, gp_Ax1& G);
0076 
0077   //! Returns the axis attribute defined by the topological attribute S and the axis G.
0078   Standard_EXPORT static Standard_Boolean Axis(const Handle(TNaming_NamedShape)& S, gp_Ax1& G);
0079 
0080   //! Returns the line attribute defined by the label L and the line G.
0081   Standard_EXPORT static Standard_Boolean Line(const TDF_Label& L, gp_Lin& G);
0082 
0083   //! Returns the line attribute defined by the topological attribute S and the line G.
0084   Standard_EXPORT static Standard_Boolean Line(const Handle(TNaming_NamedShape)& S, gp_Lin& G);
0085 
0086   //! Returns the circle attribute defined by the label L and the circle G.
0087   Standard_EXPORT static Standard_Boolean Circle(const TDF_Label& L, gp_Circ& G);
0088 
0089   //! Returns the circle attribute defined by the topological attribute S and the circle G.
0090   Standard_EXPORT static Standard_Boolean Circle(const Handle(TNaming_NamedShape)& S, gp_Circ& G);
0091 
0092   //! Returns the ellipse attribute defined by the label L and the ellipse G.
0093   Standard_EXPORT static Standard_Boolean Ellipse(const TDF_Label& L, gp_Elips& G);
0094 
0095   //! Returns the ellipse attribute defined by the
0096   //! topological attribute S and the ellipse G.
0097   Standard_EXPORT static Standard_Boolean Ellipse(const Handle(TNaming_NamedShape)& S, gp_Elips& G);
0098 
0099   //! Returns the plane attribute defined by the label L and the plane G.
0100   Standard_EXPORT static Standard_Boolean Plane(const TDF_Label& L, gp_Pln& G);
0101 
0102   //! Returns the plane attribute defined by the
0103   //! topological attribute S and the plane G.
0104   Standard_EXPORT static Standard_Boolean Plane(const Handle(TNaming_NamedShape)& S, gp_Pln& G);
0105 
0106   //! Returns the cylinder attribute defined by the label L and the cylinder G.
0107   Standard_EXPORT static Standard_Boolean Cylinder(const TDF_Label& L, gp_Cylinder& G);
0108 
0109   //! Returns the cylinder attribute defined by the
0110   //! topological attribute S and the cylinder G.
0111   Standard_EXPORT static Standard_Boolean Cylinder(const Handle(TNaming_NamedShape)& S,
0112                                                    gp_Cylinder&                      G);
0113 
0114   //! Returns the GUID for geometry attributes.
0115   Standard_EXPORT static const Standard_GUID& GetID();
0116 
0117   //! This and the next methods are used to retrieve underlying geometry of the NamedShape,
0118   //! even if no Geometry Attribute is associated.
0119   //! if not found or not compliant geometry return False.
0120   Standard_EXPORT TDataXtd_Geometry();
0121 
0122   //! Returns the type of geometric construction T of this attribute.
0123   //! T will be a value of the enumeration TDataXtd_GeometryEnum.
0124   Standard_EXPORT void SetType(const TDataXtd_GeometryEnum T);
0125 
0126   //! Returns the type of geometric construction.
0127   Standard_EXPORT TDataXtd_GeometryEnum GetType() const;
0128 
0129   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
0130 
0131   Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) Standard_OVERRIDE;
0132 
0133   Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
0134 
0135   Standard_EXPORT void Paste(const Handle(TDF_Attribute)&       into,
0136                              const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
0137 
0138   Standard_EXPORT virtual Standard_OStream& Dump(Standard_OStream& anOS) const Standard_OVERRIDE;
0139 
0140   DEFINE_STANDARD_RTTIEXT(TDataXtd_Geometry, TDF_Attribute)
0141 
0142 protected:
0143 private:
0144   TDataXtd_GeometryEnum myType;
0145 };
0146 
0147 #endif // _TDataXtd_Geometry_HeaderFile