File indexing completed on 2025-01-18 10:02:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _AIS_ColoredShape_HeaderFile
0017 #define _AIS_ColoredShape_HeaderFile
0018
0019 #include <AIS_DataMapOfShapeDrawer.hxx>
0020 #include <AIS_Shape.hxx>
0021 #include <NCollection_IndexedDataMap.hxx>
0022 #include <TopoDS_Compound.hxx>
0023 #include <TopTools_MapOfShape.hxx>
0024
0025 class StdSelect_BRepOwner;
0026
0027
0028 class AIS_ColoredShape : public AIS_Shape
0029 {
0030 public:
0031
0032
0033 Standard_EXPORT AIS_ColoredShape (const TopoDS_Shape& theShape);
0034
0035
0036 Standard_EXPORT AIS_ColoredShape (const Handle(AIS_Shape)& theShape);
0037
0038 public:
0039
0040
0041
0042
0043 Standard_EXPORT virtual Handle(AIS_ColoredDrawer) CustomAspects (const TopoDS_Shape& theShape);
0044
0045
0046 Standard_EXPORT virtual void ClearCustomAspects();
0047
0048
0049
0050 Standard_EXPORT void UnsetCustomAspects (const TopoDS_Shape& theShape,
0051 const Standard_Boolean theToUnregister = Standard_False);
0052
0053
0054 Standard_EXPORT void SetCustomColor (const TopoDS_Shape& theShape,
0055 const Quantity_Color& theColor);
0056
0057
0058 Standard_EXPORT void SetCustomTransparency (const TopoDS_Shape& theShape,
0059 Standard_Real theTransparency);
0060
0061
0062 Standard_EXPORT void SetCustomWidth (const TopoDS_Shape& theShape,
0063 const Standard_Real theLineWidth);
0064
0065
0066 const AIS_DataMapOfShapeDrawer& CustomAspectsMap() const { return myShapeColors; }
0067
0068
0069 AIS_DataMapOfShapeDrawer& ChangeCustomAspectsMap() { return myShapeColors; }
0070
0071 public:
0072
0073
0074 Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
0075
0076
0077 Standard_EXPORT virtual void SetWidth (const Standard_Real theLineWidth) Standard_OVERRIDE;
0078
0079
0080 Standard_EXPORT virtual void SetTransparency (const Standard_Real theValue) Standard_OVERRIDE;
0081
0082
0083 Standard_EXPORT virtual void SetMaterial (const Graphic3d_MaterialAspect& theAspect) Standard_OVERRIDE;
0084
0085 public:
0086
0087
0088 Standard_EXPORT virtual void UnsetTransparency() Standard_OVERRIDE;
0089
0090
0091 Standard_EXPORT virtual void UnsetWidth() Standard_OVERRIDE;
0092
0093 protected:
0094
0095
0096 Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0097 const Handle(Prs3d_Presentation)& thePrs,
0098 const Standard_Integer theMode) Standard_OVERRIDE;
0099
0100
0101 Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
0102 const Standard_Integer theMode) Standard_OVERRIDE;
0103
0104 protected:
0105
0106 typedef NCollection_IndexedDataMap<Handle(AIS_ColoredDrawer), TopoDS_Compound> DataMapOfDrawerCompd;
0107
0108 protected:
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118 Standard_EXPORT static Standard_Boolean dispatchColors (const Handle(AIS_ColoredDrawer)& theParentDrawer,
0119 const TopoDS_Shape& theShapeToParse,
0120 const AIS_DataMapOfShapeDrawer& theShapeDrawerMap,
0121 const TopAbs_ShapeEnum theParentType,
0122 const Standard_Boolean theIsParentClosed,
0123 DataMapOfDrawerCompd* theDrawerOpenedShapePerType,
0124 DataMapOfDrawerCompd& theDrawerClosedFaces);
0125 protected:
0126
0127
0128
0129 Standard_EXPORT void fillSubshapeDrawerMap (AIS_DataMapOfShapeDrawer& theSubshapeDrawerMap) const;
0130
0131
0132
0133
0134
0135
0136 Standard_EXPORT void addShapesWithCustomProps (const Handle(Prs3d_Presentation)& thePrs,
0137 const DataMapOfDrawerCompd* theDrawerOpenedShapePerType,
0138 const DataMapOfDrawerCompd& theDrawerClosedFaces,
0139 const Standard_Integer theMode);
0140
0141
0142 Standard_EXPORT Standard_Boolean isShapeEntirelyVisible() const;
0143
0144
0145
0146
0147
0148
0149
0150 Standard_EXPORT void bindSubShapes (AIS_DataMapOfShapeDrawer& theShapeDrawerMap,
0151 const TopoDS_Shape& theKeyShape,
0152 const Handle(AIS_ColoredDrawer)& theDrawer) const;
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163 Standard_EXPORT void computeSubshapeSelection (const Handle(AIS_ColoredDrawer)& theParentDrawer,
0164 const AIS_DataMapOfShapeDrawer& theShapeDrawerMap,
0165 const TopoDS_Shape& theShape,
0166 const Handle(StdSelect_BRepOwner)& theOwner,
0167 const Handle(SelectMgr_Selection)& theSelection,
0168 const TopAbs_ShapeEnum theTypOfSel,
0169 const Standard_Integer thePriority,
0170 const Standard_Real theDeflection,
0171 const Standard_Real theDeflAngle);
0172
0173 protected:
0174
0175 AIS_DataMapOfShapeDrawer myShapeColors;
0176
0177 public:
0178
0179 DEFINE_STANDARD_RTTIEXT(AIS_ColoredShape,AIS_Shape)
0180
0181 };
0182
0183 DEFINE_STANDARD_HANDLE(AIS_ColoredShape, AIS_Shape)
0184
0185 #endif