Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-14 08:40:08

0001 // Created on: 1997-01-08
0002 // Created by: VAUTHIER Jean-Claude
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _DNaming_HeaderFile
0018 #define _DNaming_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <Standard_Boolean.hxx>
0026 #include <TopTools_DataMapOfShapeShape.hxx>
0027 #include <TopTools_ListOfShape.hxx>
0028 #include <Draw_Interpretor.hxx>
0029 class TDataStd_Real;
0030 class TFunction_Function;
0031 class TDataStd_Integer;
0032 class TDataStd_Name;
0033 class TNaming_NamedShape;
0034 class gp_Ax1;
0035 class TDataStd_UAttribute;
0036 class TopoDS_Shape;
0037 class BRepBuilderAPI_MakeShape;
0038 class TNaming_Builder;
0039 class TDF_Label;
0040 class BRepAlgoAPI_BooleanOperation;
0041 class TDF_Data;
0042 class TCollection_AsciiString;
0043 
0044 class DNaming
0045 {
0046 public:
0047   DEFINE_STANDARD_ALLOC
0048 
0049   Standard_EXPORT static Handle(TDataStd_Real) GetReal(
0050     const Handle(TFunction_Function)& theFunction,
0051     const Standard_Integer            thePosition);
0052 
0053   Standard_EXPORT static Handle(TDataStd_Integer) GetInteger(
0054     const Handle(TFunction_Function)& theFunction,
0055     const Standard_Integer            thePosition);
0056 
0057   Standard_EXPORT static Handle(TDataStd_Name) GetString(
0058     const Handle(TFunction_Function)& theFunction,
0059     const Standard_Integer            thePosition);
0060 
0061   Standard_EXPORT static Standard_Boolean ComputeAxis(const Handle(TNaming_NamedShape)& theNS,
0062                                                       gp_Ax1&                           theAx1);
0063 
0064   Standard_EXPORT static Handle(TNaming_NamedShape) GetFunctionResult(
0065     const Handle(TFunction_Function)& theFunction);
0066 
0067   Standard_EXPORT static Handle(TDataStd_UAttribute) GetObjectArg(
0068     const Handle(TFunction_Function)& theFunction,
0069     const Standard_Integer            thePosition);
0070 
0071   Standard_EXPORT static void SetObjectArg(const Handle(TFunction_Function)&  theFunction,
0072                                            const Standard_Integer             thePosition,
0073                                            const Handle(TDataStd_UAttribute)& theNewValue);
0074 
0075   Standard_EXPORT static Handle(TNaming_NamedShape) GetObjectValue(
0076     const Handle(TDataStd_UAttribute)& theObject);
0077 
0078   Standard_EXPORT static Handle(TFunction_Function) GetLastFunction(
0079     const Handle(TDataStd_UAttribute)& theObject);
0080 
0081   Standard_EXPORT static Handle(TFunction_Function) GetFirstFunction(
0082     const Handle(TDataStd_UAttribute)& theObject);
0083 
0084   Standard_EXPORT static Handle(TFunction_Function) GetPrevFunction(
0085     const Handle(TFunction_Function)& theFunction);
0086 
0087   Standard_EXPORT static Handle(TDataStd_UAttribute) GetObjectFromFunction(
0088     const Handle(TFunction_Function)& theFunction);
0089 
0090   Standard_EXPORT static Standard_Boolean IsAttachment(
0091     const Handle(TDataStd_UAttribute)& theObject);
0092 
0093   Standard_EXPORT static Handle(TNaming_NamedShape) GetAttachmentsContext(
0094     const Handle(TDataStd_UAttribute)& theObject);
0095 
0096   Standard_EXPORT static Standard_Boolean ComputeSweepDir(const TopoDS_Shape& theShape,
0097                                                           gp_Ax1&             theAxis);
0098 
0099   Standard_EXPORT static void LoadAndOrientModifiedShapes(
0100     BRepBuilderAPI_MakeShape&           MakeShape,
0101     const TopoDS_Shape&                 ShapeIn,
0102     const TopAbs_ShapeEnum              GeneratedFrom,
0103     TNaming_Builder&                    Builder,
0104     const TopTools_DataMapOfShapeShape& SubShapesOfResult);
0105 
0106   Standard_EXPORT static void LoadAndOrientGeneratedShapes(
0107     BRepBuilderAPI_MakeShape&           MakeShape,
0108     const TopoDS_Shape&                 ShapeIn,
0109     const TopAbs_ShapeEnum              GeneratedFrom,
0110     TNaming_Builder&                    Builder,
0111     const TopTools_DataMapOfShapeShape& SubShapesOfResult);
0112 
0113   Standard_EXPORT static void LoadDeletedShapes(BRepBuilderAPI_MakeShape& MakeShape,
0114                                                 const TopoDS_Shape&       ShapeIn,
0115                                                 const TopAbs_ShapeEnum    KindOfDeletedShape,
0116                                                 TNaming_Builder&          Builder);
0117 
0118   Standard_EXPORT static void LoadResult(const TDF_Label&              theLabel,
0119                                          BRepAlgoAPI_BooleanOperation& MS);
0120 
0121   Standard_EXPORT static TopoDS_Shape CurrentShape(const Standard_CString  ShapeEntry,
0122                                                    const Handle(TDF_Data)& Data);
0123 
0124   Standard_EXPORT static void GetShape(const Standard_CString  ShapeEntry,
0125                                        const Handle(TDF_Data)& Data,
0126                                        TopTools_ListOfShape&   Shapes);
0127 
0128   //! theStatus = 0  Not  found,
0129   //! theStatus = 1  One  shape,
0130   //! theStatus = 2  More than one shape.
0131   Standard_EXPORT static TCollection_AsciiString GetEntry(const TopoDS_Shape&     Shape,
0132                                                           const Handle(TDF_Data)& Data,
0133                                                           Standard_Integer&       theStatus);
0134 
0135   //! Loads the Shape to DF
0136   Standard_EXPORT static void LoadImportedShape(const TDF_Label&    theResultLabel,
0137                                                 const TopoDS_Shape& theShape);
0138 
0139   //! Reloads sub-shapes of the Shape to DF
0140   Standard_EXPORT static void LoadPrime(const TDF_Label&    theResultLabel,
0141                                         const TopoDS_Shape& theShape);
0142 
0143   Standard_EXPORT static void AllCommands(Draw_Interpretor& DI);
0144 
0145   //! commands relatives to NamedShape
0146   Standard_EXPORT static void BasicCommands(Draw_Interpretor& DI);
0147 
0148   Standard_EXPORT static void ToolsCommands(Draw_Interpretor& DI);
0149 
0150   //! commands relatives to Naming
0151   Standard_EXPORT static void SelectionCommands(Draw_Interpretor& DI);
0152 
0153   //! commands for  testing Naming
0154   Standard_EXPORT static void ModelingCommands(Draw_Interpretor& DI);
0155 };
0156 
0157 #endif // _DNaming_HeaderFile