File indexing completed on 2025-01-18 10:03:23
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_ListOfEdge.hxx>
0021 #include <DBRep_ListOfFace.hxx>
0022 #include <DBRep_ListOfHideData.hxx>
0023 #include <Draw_Color.hxx>
0024 #include <Draw_Drawable3D.hxx>
0025 #include <Draw_Interpretor.hxx>
0026 #include <NCollection_DataMap.hxx>
0027 #include <NCollection_Vector.hxx>
0028 #include <Standard_OStream.hxx>
0029 #include <TopoDS_Shape.hxx>
0030
0031 class Draw_Display;
0032 class Poly_Triangulation;
0033 class gp_Trsf;
0034
0035
0036
0037 class DBRep_DrawableShape : public Draw_Drawable3D
0038 {
0039 DEFINE_STANDARD_RTTIEXT(DBRep_DrawableShape, Draw_Drawable3D)
0040 Draw_Drawable3D_FACTORY
0041 public:
0042
0043 Standard_EXPORT DBRep_DrawableShape(const TopoDS_Shape& C, const Draw_Color& FreeCol, const Draw_Color& ConnCol, const Draw_Color& EdgeCol, const Draw_Color& IsosCol, const Standard_Real size, const Standard_Integer nbisos, const Standard_Integer discret);
0044
0045
0046 Standard_EXPORT void ChangeNbIsos (const Standard_Integer NbIsos);
0047
0048
0049 Standard_EXPORT Standard_Integer NbIsos() const;
0050
0051
0052 Standard_EXPORT void ChangeDiscret (const Standard_Integer Discret);
0053
0054
0055 Standard_EXPORT Standard_Integer Discret() const;
0056
0057
0058 Standard_EXPORT TopoDS_Shape Shape() const;
0059
0060
0061
0062 Standard_EXPORT void DisplayOrientation (const Standard_Boolean D);
0063
0064
0065
0066 Standard_EXPORT void DisplayTriangulation (const Standard_Boolean D);
0067
0068
0069
0070 Standard_EXPORT void DisplayPolygons (const Standard_Boolean D);
0071
0072
0073 Standard_EXPORT void DisplayHLR (const Standard_Boolean withHLR, const Standard_Boolean withRg1, const Standard_Boolean withRgN, const Standard_Boolean withHid, const Standard_Real ang);
0074
0075 Standard_EXPORT Standard_Boolean DisplayTriangulation() const;
0076
0077 Standard_EXPORT Standard_Boolean DisplayPolygons() const;
0078
0079 Standard_EXPORT void GetDisplayHLR (Standard_Boolean& withHLR, Standard_Boolean& withRg1, Standard_Boolean& withRgN, Standard_Boolean& withHid, Standard_Real& ang) const;
0080
0081 Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
0082
0083 Standard_EXPORT void DisplayHiddenLines (Draw_Display& dis);
0084
0085
0086 Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const Standard_OVERRIDE;
0087
0088
0089 Standard_EXPORT virtual void Dump (Standard_OStream& S) const Standard_OVERRIDE;
0090
0091
0092 Standard_EXPORT virtual void Save (Standard_OStream& theStream) const Standard_OVERRIDE;
0093
0094
0095 Standard_EXPORT virtual void Whatis (Draw_Interpretor& I) const Standard_OVERRIDE;
0096
0097
0098
0099 Standard_EXPORT static void LastPick (TopoDS_Shape& S, Standard_Real& u, Standard_Real& v);
0100
0101 public:
0102
0103
0104
0105
0106
0107
0108 Standard_EXPORT static Standard_Boolean addMeshNormals (NCollection_Vector<std::pair<gp_Pnt, gp_Pnt> >& theNormals,
0109 const TopoDS_Face& theFace,
0110 const Standard_Real theLength);
0111
0112
0113
0114
0115
0116 Standard_EXPORT static void addMeshNormals (NCollection_DataMap<TopoDS_Face, NCollection_Vector<std::pair<gp_Pnt, gp_Pnt> > > & theNormals,
0117 const TopoDS_Shape& theShape,
0118 const Standard_Real theLength);
0119
0120
0121
0122
0123
0124
0125
0126
0127 Standard_EXPORT static Standard_Boolean addSurfaceNormals (NCollection_Vector<std::pair<gp_Pnt, gp_Pnt> >& theNormals,
0128 const TopoDS_Face& theFace,
0129 const Standard_Real theLength,
0130 const Standard_Integer theNbAlongU,
0131 const Standard_Integer theNbAlongV);
0132
0133
0134
0135
0136
0137
0138
0139
0140 Standard_EXPORT static void addSurfaceNormals (NCollection_DataMap<TopoDS_Face, NCollection_Vector<std::pair<gp_Pnt, gp_Pnt> > >& theNormals,
0141 const TopoDS_Shape& theShape,
0142 const Standard_Real theLength,
0143 const Standard_Integer theNbAlongU,
0144 const Standard_Integer theNbAlongV);
0145
0146 private:
0147
0148 void display (const Handle(Poly_Triangulation)& T, const gp_Trsf& tr, Draw_Display& dis) const;
0149
0150
0151 void updateDisplayData () const;
0152
0153 private:
0154
0155 TopoDS_Shape myShape;
0156
0157 mutable DBRep_ListOfEdge myEdges;
0158 mutable DBRep_ListOfFace myFaces;
0159 DBRep_ListOfHideData myHidData;
0160
0161 Standard_Real mySize;
0162 Standard_Integer myDiscret;
0163 Draw_Color myFreeCol;
0164 Draw_Color myConnCol;
0165 Draw_Color myEdgeCol;
0166 Draw_Color myIsosCol;
0167 Standard_Integer myNbIsos;
0168 Standard_Boolean myDispOr;
0169 Standard_Boolean mytriangulations;
0170 Standard_Boolean mypolygons;
0171 Standard_Boolean myHLR;
0172 Standard_Boolean myRg1;
0173 Standard_Boolean myRgN;
0174 Standard_Boolean myHid;
0175 Standard_Real myAng;
0176
0177 };
0178
0179 DEFINE_STANDARD_HANDLE(DBRep_DrawableShape, Draw_Drawable3D)
0180
0181 #endif