File indexing completed on 2025-01-18 10:02:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _AIS_Trihedron_HeaderFile
0018 #define _AIS_Trihedron_HeaderFile
0019
0020 #include <AIS_InteractiveObject.hxx>
0021 #include <AIS_KindOfInteractive.hxx>
0022 #include <Graphic3d_ArrayOfTriangles.hxx>
0023 #include <PrsMgr_PresentationManager.hxx>
0024 #include <Prs3d_DatumAspect.hxx>
0025 #include <Prs3d_DatumMode.hxx>
0026 #include <Prs3d_DatumParts.hxx>
0027 #include <Prs3d_LineAspect.hxx>
0028 #include <SelectMgr_Selection.hxx>
0029 #include <Quantity_Color.hxx>
0030
0031 class Geom_Axis2Placement;
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 class AIS_Trihedron : public AIS_InteractiveObject
0052 {
0053 DEFINE_STANDARD_RTTIEXT(AIS_Trihedron, AIS_InteractiveObject)
0054 public:
0055
0056
0057 Standard_EXPORT AIS_Trihedron (const Handle(Geom_Axis2Placement)& theComponent);
0058
0059
0060 Prs3d_DatumMode DatumDisplayMode() const { return myTrihDispMode; }
0061
0062
0063 void SetDatumDisplayMode (Prs3d_DatumMode theMode) { myTrihDispMode = theMode; }
0064
0065
0066 const Handle(Geom_Axis2Placement)& Component() const { return myComponent; }
0067
0068
0069 Standard_EXPORT void SetComponent (const Handle(Geom_Axis2Placement)& theComponent);
0070
0071
0072
0073 Standard_Boolean HasOwnSize() const { return myHasOwnSize; }
0074
0075
0076 Standard_EXPORT Standard_Real Size() const;
0077
0078
0079 Standard_EXPORT void SetSize (const Standard_Real theValue);
0080
0081
0082
0083
0084 Standard_EXPORT void UnsetSize();
0085
0086
0087 Standard_Boolean HasTextColor() const { return myHasOwnTextColor; }
0088
0089
0090 Standard_EXPORT Quantity_Color TextColor() const;
0091
0092
0093 Standard_EXPORT void SetTextColor (const Quantity_Color& theColor);
0094
0095
0096 Standard_EXPORT void SetTextColor (const Prs3d_DatumParts thePart,
0097 const Quantity_Color& theColor);
0098
0099
0100 Standard_Boolean HasArrowColor() const { return myHasOwnArrowColor; }
0101
0102
0103 Standard_EXPORT Quantity_Color ArrowColor() const;
0104
0105
0106 Standard_EXPORT void SetArrowColor (const Quantity_Color& theColor);
0107
0108
0109 Standard_EXPORT void SetArrowColor (const Prs3d_DatumParts thePart,
0110 const Quantity_Color& theColor);
0111
0112
0113 Standard_EXPORT Quantity_Color DatumPartColor (Prs3d_DatumParts thePart);
0114
0115
0116
0117 Standard_EXPORT void SetDatumPartColor (const Prs3d_DatumParts thePart,
0118 const Quantity_Color& theColor);
0119
0120
0121 Standard_EXPORT void SetOriginColor (const Quantity_Color& theColor);
0122
0123
0124
0125 Standard_EXPORT void SetXAxisColor (const Quantity_Color& theColor);
0126
0127
0128
0129 Standard_EXPORT void SetYAxisColor (const Quantity_Color& theColor);
0130
0131
0132
0133 Standard_EXPORT void SetAxisColor (const Quantity_Color& theColor);
0134
0135
0136 Standard_EXPORT Standard_Boolean ToDrawArrows() const;
0137
0138
0139 Standard_EXPORT void SetDrawArrows (const Standard_Boolean theToDraw);
0140
0141
0142 Standard_Integer SelectionPriority (Prs3d_DatumParts thePart) { return mySelectionPriority[thePart]; }
0143
0144
0145 void SetSelectionPriority (Prs3d_DatumParts thePart,
0146 Standard_Integer thePriority)
0147 {
0148 mySelectionPriority[thePart] = thePriority;
0149 }
0150
0151
0152 const TCollection_ExtendedString& Label (Prs3d_DatumParts thePart) { return myLabels[thePart]; }
0153
0154
0155 void SetLabel (const Prs3d_DatumParts thePart,
0156 const TCollection_ExtendedString& theName)
0157 {
0158 myLabels[thePart] = theName;
0159 }
0160
0161 public:
0162
0163
0164 Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
0165
0166
0167 virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE
0168 {
0169 return theMode == 0;
0170 }
0171
0172
0173 virtual Standard_Integer Signature() const Standard_OVERRIDE { return 3; }
0174
0175
0176 virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KindOfInteractive_Datum; }
0177
0178
0179 Standard_EXPORT virtual void UnsetColor() Standard_OVERRIDE;
0180
0181 public:
0182
0183
0184
0185 Standard_EXPORT virtual void ClearSelected() Standard_OVERRIDE;
0186
0187
0188 Standard_EXPORT virtual void HilightSelected (const Handle(PrsMgr_PresentationManager)& thePM,
0189 const SelectMgr_SequenceOfOwner& theOwners) Standard_OVERRIDE;
0190
0191
0192
0193 Standard_EXPORT virtual void HilightOwnerWithColor (const Handle(PrsMgr_PresentationManager)& thePM,
0194 const Handle(Prs3d_Drawer)& theStyle,
0195 const Handle(SelectMgr_EntityOwner)& theOwner) Standard_OVERRIDE;
0196
0197 protected:
0198
0199
0200 Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0201 const Handle(Prs3d_Presentation)& thePrs,
0202 const Standard_Integer theMode) Standard_OVERRIDE;
0203
0204
0205 Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
0206 const Standard_Integer theMode) Standard_OVERRIDE;
0207
0208
0209 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0210
0211 protected:
0212
0213
0214 Standard_EXPORT Handle(Select3D_SensitiveEntity) createSensitiveEntity (const Prs3d_DatumParts thePart,
0215 const Handle(SelectMgr_EntityOwner)& theOwner) const;
0216
0217
0218 Standard_EXPORT void computePresentation (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0219 const Handle(Prs3d_Presentation)& thePrs);
0220
0221
0222 Standard_EXPORT void setOwnDatumAspect();
0223
0224
0225 const Handle(Graphic3d_ArrayOfPrimitives)& arrayOfPrimitives (Prs3d_DatumParts thePart) const { return myPrimitives[thePart]; }
0226
0227
0228
0229 Standard_EXPORT void updatePrimitives (const Handle(Prs3d_DatumAspect)& theAspect,
0230 Prs3d_DatumMode theMode,
0231 const gp_Pnt& theOrigin,
0232 const gp_Dir& theXDir,
0233 const gp_Dir& theYDir,
0234 const gp_Dir& theZDir);
0235
0236 protected:
0237 Handle(Geom_Axis2Placement) myComponent;
0238 Prs3d_DatumMode myTrihDispMode;
0239 Standard_Boolean myHasOwnSize;
0240 Standard_Boolean myHasOwnTextColor;
0241 Standard_Boolean myHasOwnArrowColor;
0242
0243 TCollection_ExtendedString myLabels[Prs3d_DatumParts_NB];
0244 Standard_Integer mySelectionPriority[Prs3d_DatumParts_NB];
0245
0246 Handle(Graphic3d_Group) myPartToGroup[Prs3d_DatumParts_NB];
0247 NCollection_List<Prs3d_DatumParts> mySelectedParts;
0248 Handle(Graphic3d_AspectLine3d) myHiddenLineAspect;
0249
0250 Handle(Graphic3d_ArrayOfPrimitives) myPrimitives[Prs3d_DatumParts_NB];
0251 };
0252
0253 DEFINE_STANDARD_HANDLE(AIS_Trihedron, AIS_InteractiveObject)
0254
0255 #endif