File indexing completed on 2026-08-17 09:15:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _V3d_Trihedron_HeaderFile
0017 #define _V3d_Trihedron_HeaderFile
0018
0019 #include <Graphic3d_StructureManager.hxx>
0020 #include <Graphic3d_TransformPers.hxx>
0021 #include <Prs3d_LineAspect.hxx>
0022 #include <Prs3d_ShadingAspect.hxx>
0023 #include <Prs3d_TextAspect.hxx>
0024 #include <V3d_TypeOfAxe.hxx>
0025
0026 class V3d_View;
0027
0028
0029 class V3d_Trihedron : public Standard_Transient
0030 {
0031 DEFINE_STANDARD_RTTIEXT(V3d_Trihedron, Standard_Transient)
0032 public:
0033
0034 Standard_EXPORT V3d_Trihedron();
0035
0036
0037 Standard_EXPORT virtual ~V3d_Trihedron();
0038
0039
0040 bool IsWireframe() const { return myIsWireframe; }
0041
0042
0043 void SetWireframe(const Standard_Boolean theAsWireframe)
0044 {
0045 if (myIsWireframe != theAsWireframe)
0046 {
0047 invalidate();
0048 myIsWireframe = theAsWireframe;
0049 }
0050 }
0051
0052
0053 const Handle(Graphic3d_TransformPers) TransformPersistence() const { return myTransformPers; }
0054
0055
0056 Standard_EXPORT void SetPosition(const Aspect_TypeOfTriedronPosition thePosition);
0057
0058
0059 Standard_Real Scale() const { return myScale; }
0060
0061
0062 Standard_EXPORT void SetScale(const Standard_Real theScale);
0063
0064
0065 Standard_Real SizeRatio() const { return myRatio; }
0066
0067
0068 Standard_EXPORT void SetSizeRatio(const Standard_Real theRatio);
0069
0070
0071 Standard_Real ArrowDiameter() const { return myDiameter; }
0072
0073
0074 Standard_EXPORT void SetArrowDiameter(const Standard_Real theDiam);
0075
0076
0077 Standard_Integer NbFacets() const { return myNbFacettes; }
0078
0079
0080 Standard_EXPORT void SetNbFacets(const Standard_Integer theNbFacets);
0081
0082
0083
0084
0085 const Handle(Prs3d_TextAspect)& LabelAspect(V3d_TypeOfAxe theAxis) const
0086 {
0087 return myTextAspects[theAxis];
0088 }
0089
0090
0091 Standard_EXPORT void SetLabelsColor(const Quantity_Color& theXColor,
0092 const Quantity_Color& theYColor,
0093 const Quantity_Color& theZColor);
0094
0095
0096 Standard_EXPORT void SetLabelsColor(const Quantity_Color& theColor);
0097
0098
0099
0100
0101 const Handle(Prs3d_ShadingAspect)& ArrowAspect(V3d_TypeOfAxe theAxis) const
0102 {
0103 return myArrowShadingAspects[theAxis];
0104 }
0105
0106
0107 Standard_EXPORT void SetArrowsColor(const Quantity_Color& theXColor,
0108 const Quantity_Color& theYColor,
0109 const Quantity_Color& theZColor);
0110
0111
0112 const Handle(Prs3d_ShadingAspect)& OriginAspect() const { return mySphereShadingAspect; }
0113
0114
0115
0116
0117 const TCollection_AsciiString& Label(V3d_TypeOfAxe theAxis) const { return myLabels[theAxis]; }
0118
0119
0120 Standard_EXPORT void SetLabels(const TCollection_AsciiString& theX,
0121 const TCollection_AsciiString& theY,
0122 const TCollection_AsciiString& theZ);
0123
0124
0125 void Display(const Handle(V3d_View)& theView) { Display(*theView); }
0126
0127
0128 Standard_EXPORT void Display(const V3d_View& theView);
0129
0130
0131 Standard_EXPORT void Erase();
0132
0133
0134 Standard_EXPORT void DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0135
0136 protected:
0137
0138 Standard_EXPORT void compute();
0139
0140
0141 void invalidate() { myToCompute = Standard_True; }
0142
0143
0144 Standard_EXPORT void setOffset2d();
0145
0146 private:
0147
0148 class TrihedronStructure;
0149
0150 protected:
0151 Handle(Prs3d_ShadingAspect) mySphereShadingAspect;
0152 Handle(Prs3d_TextAspect) myTextAspects[3];
0153 Handle(Prs3d_ShadingAspect) myArrowShadingAspects[3];
0154 TCollection_AsciiString myLabels[3];
0155
0156 Handle(Graphic3d_Structure) myStructure;
0157 Handle(Graphic3d_TransformPers) myTransformPers;
0158
0159 Standard_Real myScale;
0160 Standard_Real myRatio;
0161 Standard_Real myDiameter;
0162 Standard_Integer myNbFacettes;
0163 Standard_Boolean myIsWireframe;
0164 Standard_Boolean myToCompute;
0165 };
0166
0167 DEFINE_STANDARD_HANDLE(V3d_Trihedron, Standard_Transient)
0168
0169 #endif