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