File indexing completed on 2025-01-18 10:05:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _TopoDS_TShape_HeaderFile
0018 #define _TopoDS_TShape_HeaderFile
0019
0020 #include <TopAbs.hxx>
0021 #include <TopAbs_ShapeEnum.hxx>
0022 #include <TopoDS_ListOfShape.hxx>
0023
0024
0025
0026 #ifdef Convex
0027 #undef Convex
0028 #endif
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055 class TopoDS_TShape : public Standard_Transient
0056 {
0057
0058 public:
0059
0060
0061 Standard_Boolean Free() const { return ((myFlags & TopoDS_TShape_Flags_Free) != 0); }
0062
0063
0064 void Free (Standard_Boolean theIsFree) { setFlag (TopoDS_TShape_Flags_Free, theIsFree); }
0065
0066
0067 Standard_Boolean Locked() const { return ((myFlags & TopoDS_TShape_Flags_Locked) != 0); }
0068
0069
0070 void Locked (Standard_Boolean theIsLocked) { setFlag (TopoDS_TShape_Flags_Locked, theIsLocked); }
0071
0072
0073 Standard_Boolean Modified() const { return ((myFlags & TopoDS_TShape_Flags_Modified) != 0); }
0074
0075
0076 void Modified (Standard_Boolean theIsModified)
0077 {
0078 setFlag (TopoDS_TShape_Flags_Modified, theIsModified);
0079 if (theIsModified)
0080 {
0081 setFlag (TopoDS_TShape_Flags_Checked, false);
0082 }
0083 }
0084
0085
0086 Standard_Boolean Checked() const { return ((myFlags & TopoDS_TShape_Flags_Checked) != 0); }
0087
0088
0089 void Checked (Standard_Boolean theIsChecked) { setFlag (TopoDS_TShape_Flags_Checked, theIsChecked); }
0090
0091
0092 Standard_Boolean Orientable() const { return ((myFlags & TopoDS_TShape_Flags_Orientable) != 0); }
0093
0094
0095 void Orientable (Standard_Boolean theIsOrientable) { setFlag (TopoDS_TShape_Flags_Orientable, theIsOrientable); }
0096
0097
0098 Standard_Boolean Closed() const { return ((myFlags & TopoDS_TShape_Flags_Closed) != 0); }
0099
0100
0101 void Closed (Standard_Boolean theIsClosed) { setFlag (TopoDS_TShape_Flags_Closed, theIsClosed); }
0102
0103
0104 Standard_Boolean Infinite() const { return ((myFlags & TopoDS_TShape_Flags_Infinite) != 0); }
0105
0106
0107 void Infinite (Standard_Boolean theIsInfinite) { setFlag (TopoDS_TShape_Flags_Infinite, theIsInfinite); }
0108
0109
0110 Standard_Boolean Convex() const { return ((myFlags & TopoDS_TShape_Flags_Convex) != 0); }
0111
0112
0113 void Convex (Standard_Boolean theIsConvex) { setFlag (TopoDS_TShape_Flags_Convex, theIsConvex); }
0114
0115
0116
0117 Standard_EXPORT virtual TopAbs_ShapeEnum ShapeType() const = 0;
0118
0119
0120 Standard_EXPORT virtual Handle(TopoDS_TShape) EmptyCopy() const = 0;
0121
0122
0123
0124 Standard_Integer NbChildren() const { return myShapes.Size(); }
0125
0126
0127 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0128
0129 friend class TopoDS_Iterator;
0130 friend class TopoDS_Builder;
0131
0132
0133 DEFINE_STANDARD_RTTIEXT(TopoDS_TShape,Standard_Transient)
0134
0135 protected:
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145 TopoDS_TShape()
0146 : myFlags (TopoDS_TShape_Flags_Free
0147 | TopoDS_TShape_Flags_Modified
0148 | TopoDS_TShape_Flags_Orientable) {}
0149
0150 private:
0151
0152
0153 enum TopoDS_TShape_Flags
0154 {
0155 TopoDS_TShape_Flags_Free = 0x001,
0156 TopoDS_TShape_Flags_Modified = 0x002,
0157 TopoDS_TShape_Flags_Checked = 0x004,
0158 TopoDS_TShape_Flags_Orientable = 0x008,
0159 TopoDS_TShape_Flags_Closed = 0x010,
0160 TopoDS_TShape_Flags_Infinite = 0x020,
0161 TopoDS_TShape_Flags_Convex = 0x040,
0162 TopoDS_TShape_Flags_Locked = 0x080
0163 };
0164
0165
0166 void setFlag (TopoDS_TShape_Flags theFlag,
0167 Standard_Boolean theIsOn)
0168 {
0169 if (theIsOn) myFlags |= (Standard_Integer )theFlag;
0170 else myFlags &= ~(Standard_Integer )theFlag;
0171 }
0172
0173 private:
0174
0175 TopoDS_ListOfShape myShapes;
0176 Standard_Integer myFlags;
0177 };
0178
0179 DEFINE_STANDARD_HANDLE(TopoDS_TShape, Standard_Transient)
0180
0181 #endif