1 // Created on: 2009-04-06
2 // Created by: Sergey ZARITCHNY
3 // Copyright (c) 2009-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _TDataXtd_Geometry_HeaderFile
17 #define _TDataXtd_Geometry_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <TDataXtd_GeometryEnum.hxx>
23 #include <TDF_Attribute.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_OStream.hxx>
27 class TNaming_NamedShape;
37 class TDF_RelocationTable;
40 class TDataXtd_Geometry;
41 DEFINE_STANDARD_HANDLE(TDataXtd_Geometry, TDF_Attribute)
43 //! This class is used to model construction geometry.
44 //! The specific geometric construction of the
45 //! attribute is defined by an element of the
46 //! enumeration TDataXtd_GeometryEnum.
47 //! This attribute may also be used to qualify underlying
48 //! geometry of the associated NamedShape. for
49 //! Constructuion element by example.
50 class TDataXtd_Geometry : public TDF_Attribute
58 //! Finds, or creates, a Geometry attribute defined by the label label.
59 //! The default type of geometry is the value
60 //! ANY_GEOM of the enumeration TDataXtd_GeometryEnum.
61 //! To specify another value of this enumeration, use
62 //! the function SetType.
63 Standard_EXPORT static Handle(TDataXtd_Geometry) Set (const TDF_Label& label);
66 //! Returns the label L used to define the type of
67 //! geometric construction for the geometry attribute.
68 Standard_EXPORT static TDataXtd_GeometryEnum Type (const TDF_Label& L);
70 //! Returns the topological attribute S used to define
71 //! the type of geometric construction for the geometry attribute.
72 Standard_EXPORT static TDataXtd_GeometryEnum Type (const Handle(TNaming_NamedShape)& S);
75 //! Returns the point attribute defined by the label L and the point G.
76 Standard_EXPORT static Standard_Boolean Point (const TDF_Label& L, gp_Pnt& G);
79 //! Returns the point attribute defined by the topological attribute S and the point G.
80 Standard_EXPORT static Standard_Boolean Point (const Handle(TNaming_NamedShape)& S, gp_Pnt& G);
83 //! Returns the axis attribute defined by the label L and the axis G.
84 Standard_EXPORT static Standard_Boolean Axis (const TDF_Label& L, gp_Ax1& G);
87 //! Returns the axis attribute defined by the topological attribute S and the axis G.
88 Standard_EXPORT static Standard_Boolean Axis (const Handle(TNaming_NamedShape)& S, gp_Ax1& G);
91 //! Returns the line attribute defined by the label L and the line G.
92 Standard_EXPORT static Standard_Boolean Line (const TDF_Label& L, gp_Lin& G);
95 //! Returns the line attribute defined by the topological attribute S and the line G.
96 Standard_EXPORT static Standard_Boolean Line (const Handle(TNaming_NamedShape)& S, gp_Lin& G);
99 //! Returns the circle attribute defined by the label L and the circle G.
100 Standard_EXPORT static Standard_Boolean Circle (const TDF_Label& L, gp_Circ& G);
103 //! Returns the circle attribute defined by the topological attribute S and the circle G.
104 Standard_EXPORT static Standard_Boolean Circle (const Handle(TNaming_NamedShape)& S, gp_Circ& G);
107 //! Returns the ellipse attribute defined by the label L and the ellipse G.
108 Standard_EXPORT static Standard_Boolean Ellipse (const TDF_Label& L, gp_Elips& G);
111 //! Returns the ellipse attribute defined by the
112 //! topological attribute S and the ellipse G.
113 Standard_EXPORT static Standard_Boolean Ellipse (const Handle(TNaming_NamedShape)& S, gp_Elips& G);
116 //! Returns the plane attribute defined by the label L and the plane G.
117 Standard_EXPORT static Standard_Boolean Plane (const TDF_Label& L, gp_Pln& G);
120 //! Returns the plane attribute defined by the
121 //! topological attribute S and the plane G.
122 Standard_EXPORT static Standard_Boolean Plane (const Handle(TNaming_NamedShape)& S, gp_Pln& G);
125 //! Returns the cylinder attribute defined by the label L and the cylinder G.
126 Standard_EXPORT static Standard_Boolean Cylinder (const TDF_Label& L, gp_Cylinder& G);
129 //! Returns the cylinder attribute defined by the
130 //! topological attribute S and the cylinder G.
131 Standard_EXPORT static Standard_Boolean Cylinder (const Handle(TNaming_NamedShape)& S, gp_Cylinder& G);
133 //! Returns the GUID for geometry attributes.
134 Standard_EXPORT static const Standard_GUID& GetID();
136 //! This and the next methods are used to retrieve underlying geometry of the
137 //! NamedShape, even if noone Geometry Attribute is
138 //! associated . if not found or not compliant geometry return False.
139 Standard_EXPORT TDataXtd_Geometry();
141 //! Returns the type of geometric construction T of this attribute.
142 //! T will be a value of the enumeration TDataXtd_GeometryEnum.
143 Standard_EXPORT void SetType (const TDataXtd_GeometryEnum T);
145 //! Returns the type of geometric construction.
146 Standard_EXPORT TDataXtd_GeometryEnum GetType() const;
148 Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
150 Standard_EXPORT void Restore (const Handle(TDF_Attribute)& with) Standard_OVERRIDE;
152 Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
154 Standard_EXPORT void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
156 Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
161 DEFINE_STANDARD_RTTI(TDataXtd_Geometry,TDF_Attribute)
171 TDataXtd_GeometryEnum myType;
182 #endif // _TDataXtd_Geometry_HeaderFile