1 // Created on: 1991-06-25
2 // Created by: Christophe MARION
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _DBRep_HeaderFile
18 #define _DBRep_HeaderFile
20 #include <Draw_Interpretor.hxx>
21 #include <TCollection_AsciiString.hxx>
22 #include <TopAbs_ShapeEnum.hxx>
23 #include <TopoDS_Shape.hxx>
25 //! Used to display BRep objects using the DrawTrSurf
27 //! The DrawableShape is a Display object build from a
29 //! Provides methods to manage a directory of named shapes.
30 //! Provides a set of Draw commands for Shapes.
38 //! Creation of isoparametric curves.
39 //! Implements ProgressIndicator for DRAW
40 //! Sets <S> in the variable <Name>. Overwrite the
41 //! variable if already set.
42 Standard_EXPORT static void Set (const Standard_CString Name, const TopoDS_Shape& S);
44 //! Returns the shape in the variable.
45 //! @param theName [in] [out] variable name, or "." to pick up shape interactively (the picked name will be returned then)
46 //! @param theType [in] shape type filter; function will return NULL if shape has different type
47 //! @param theToComplain [in] when TRUE, prints a message on cout if the variable is not set
48 static TopoDS_Shape Get (Standard_CString& theName, TopAbs_ShapeEnum theType = TopAbs_SHAPE, Standard_Boolean theToComplain = Standard_False)
50 return getShape (theName, theType, theToComplain);
53 //! Returns the shape in the variable.
54 //! @param theName [in] [out] variable name, or "." to pick up shape interactively (the picked name will be returned then)
55 //! @param theType [in] shape type filter; function will return NULL if shape has different type
56 //! @param theToComplain [in] when TRUE, prints a message on cout if the variable is not set
57 static TopoDS_Shape Get (TCollection_AsciiString& theName, TopAbs_ShapeEnum theType = TopAbs_SHAPE, Standard_Boolean theToComplain = Standard_False)
59 Standard_CString aNamePtr = theName.ToCString();
60 TopoDS_Shape aShape = getShape (aNamePtr, theType, theToComplain);
61 if (aNamePtr != theName.ToCString())
68 //! Returns the shape in the variable.
69 //! @param theName [in] variable name
70 //! @param theType [in] shape type filter; function will return NULL if shape has different type
71 //! @param theToComplain [in] when TRUE, prints a message on cout if the variable is not set
72 static TopoDS_Shape GetExisting (const TCollection_AsciiString& theName, TopAbs_ShapeEnum theType = TopAbs_SHAPE, Standard_Boolean theToComplain = Standard_False)
74 if (theName.Length() == 1
75 && theName.Value (1) == '.')
77 return TopoDS_Shape();
80 Standard_CString aNamePtr = theName.ToCString();
81 return getShape (aNamePtr, theType, theToComplain);
84 //! Defines the basic commands.
85 Standard_EXPORT static void BasicCommands (Draw_Interpretor& theCommands);
87 //! True if HLR, False if wireframe.
88 Standard_EXPORT static Standard_Boolean HLRMode();
90 //! True if display Rg1Lines.
91 Standard_EXPORT static Standard_Boolean Rg1Mode();
93 //! True if display RgNLines.
94 Standard_EXPORT static Standard_Boolean RgNMode();
96 //! True if display HiddenLines.
97 Standard_EXPORT static Standard_Boolean HidMode();
99 //! discretisation angle for edges.
100 Standard_EXPORT static Standard_Real HLRAngle();
102 //! number of iso in U and V
103 Standard_EXPORT static Standard_Integer NbIsos();
105 //! discretisation number of points for curves
106 //! set progress indicator
107 //! get progress indicator
108 Standard_EXPORT static Standard_Integer Discretisation();
112 //! Returns the shape in the variable.
113 //! @param theName [in] [out] variable name, or "." to pick up shape interactively (the picked name will be returned then)
114 //! @param theType [in] shape type filter; function will return NULL if shape has different type
115 //! @param theToComplain [in] when TRUE, prints a message on cout if the variable is not set
116 Standard_EXPORT static TopoDS_Shape getShape (Standard_CString& theName,
117 TopAbs_ShapeEnum theType,
118 Standard_Boolean theToComplain);
122 #endif // _DBRep_HeaderFile