File indexing completed on 2026-09-29 09:18:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _DBRep_DrawableShape_HeaderFile
0018 #define _DBRep_DrawableShape_HeaderFile
0019
0020 #include <DBRep_Edge.hxx>
0021 #include <NCollection_List.hxx>
0022 #include <DBRep_Face.hxx>
0023 #include <DBRep_HideData.hxx>
0024 #include <Draw_Color.hxx>
0025 #include <Draw_Drawable3D.hxx>
0026 #include <Draw_Interpretor.hxx>
0027 #include <NCollection_DataMap.hxx>
0028 #include <NCollection_DynamicArray.hxx>
0029 #include <Standard_OStream.hxx>
0030 #include <TopoDS_Shape.hxx>
0031
0032 class Draw_Display;
0033 class Poly_Triangulation;
0034 class gp_Trsf;
0035
0036
0037
0038 class DBRep_DrawableShape : public Draw_Drawable3D
0039 {
0040 DEFINE_STANDARD_RTTIEXT(DBRep_DrawableShape, Draw_Drawable3D)
0041 Draw_Drawable3D_FACTORY
0042 public:
0043 Standard_EXPORT DBRep_DrawableShape(const TopoDS_Shape& C,
0044 const Draw_Color& FreeCol,
0045 const Draw_Color& ConnCol,
0046 const Draw_Color& EdgeCol,
0047 const Draw_Color& IsosCol,
0048 const double size,
0049 const int nbisos,
0050 const int discret);
0051
0052
0053 Standard_EXPORT void ChangeNbIsos(const int NbIsos);
0054
0055
0056 Standard_EXPORT int NbIsos() const;
0057
0058
0059 Standard_EXPORT void ChangeDiscret(const int Discret);
0060
0061
0062 Standard_EXPORT int Discret() const;
0063
0064
0065 Standard_EXPORT TopoDS_Shape Shape() const;
0066
0067
0068
0069 Standard_EXPORT void DisplayOrientation(const bool D);
0070
0071
0072
0073 Standard_EXPORT void DisplayTriangulation(const bool D);
0074
0075
0076
0077 Standard_EXPORT void DisplayPolygons(const bool D);
0078
0079
0080 Standard_EXPORT void DisplayHLR(const bool withHLR,
0081 const bool withRg1,
0082 const bool withRgN,
0083 const bool withHid,
0084 const double ang);
0085
0086 Standard_EXPORT bool DisplayTriangulation() const;
0087
0088 Standard_EXPORT bool DisplayPolygons() const;
0089
0090 Standard_EXPORT void GetDisplayHLR(bool& withHLR,
0091 bool& withRg1,
0092 bool& withRgN,
0093 bool& withHid,
0094 double& ang) const;
0095
0096 Standard_EXPORT void DrawOn(Draw_Display& dis) const override;
0097
0098 Standard_EXPORT void DisplayHiddenLines(Draw_Display& dis);
0099
0100
0101 Standard_EXPORT occ::handle<Draw_Drawable3D> Copy() const override;
0102
0103
0104 Standard_EXPORT void Dump(Standard_OStream& S) const override;
0105
0106
0107 Standard_EXPORT void Save(Standard_OStream& theStream) const override;
0108
0109
0110 Standard_EXPORT void Whatis(Draw_Interpretor& I) const override;
0111
0112
0113
0114 Standard_EXPORT static void LastPick(TopoDS_Shape& S, double& u, double& v);
0115
0116 public:
0117
0118
0119
0120
0121
0122 Standard_EXPORT static bool addMeshNormals(
0123 NCollection_DynamicArray<std::pair<gp_Pnt, gp_Pnt>>& theNormals,
0124 const TopoDS_Face& theFace,
0125 const double theLength);
0126
0127
0128
0129
0130
0131 Standard_EXPORT static void addMeshNormals(
0132 NCollection_DataMap<TopoDS_Face, NCollection_DynamicArray<std::pair<gp_Pnt, gp_Pnt>>>&
0133 theNormals,
0134 const TopoDS_Shape& theShape,
0135 const double theLength);
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145 Standard_EXPORT static bool addSurfaceNormals(
0146 NCollection_DynamicArray<std::pair<gp_Pnt, gp_Pnt>>& theNormals,
0147 const TopoDS_Face& theFace,
0148 const double theLength,
0149 const int theNbAlongU,
0150 const int theNbAlongV);
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160 Standard_EXPORT static void addSurfaceNormals(
0161 NCollection_DataMap<TopoDS_Face, NCollection_DynamicArray<std::pair<gp_Pnt, gp_Pnt>>>&
0162 theNormals,
0163 const TopoDS_Shape& theShape,
0164 const double theLength,
0165 const int theNbAlongU,
0166 const int theNbAlongV);
0167
0168 private:
0169 void display(const occ::handle<Poly_Triangulation>& T,
0170 const gp_Trsf& tr,
0171 Draw_Display& dis) const;
0172
0173
0174 void updateDisplayData() const;
0175
0176 private:
0177 TopoDS_Shape myShape;
0178
0179 mutable NCollection_List<occ::handle<DBRep_Edge>> myEdges;
0180 mutable NCollection_List<occ::handle<DBRep_Face>> myFaces;
0181 NCollection_List<DBRep_HideData> myHidData;
0182
0183 double mySize;
0184 int myDiscret;
0185 Draw_Color myFreeCol;
0186 Draw_Color myConnCol;
0187 Draw_Color myEdgeCol;
0188 Draw_Color myIsosCol;
0189 int myNbIsos;
0190 bool myDispOr;
0191 bool mytriangulations;
0192 bool mypolygons;
0193 bool myHLR;
0194 bool myRg1;
0195 bool myRgN;
0196 bool myHid;
0197 double myAng;
0198 };
0199
0200 #endif