File indexing completed on 2025-01-18 10:05:30
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
0035 Standard_EXPORT V3d_Trihedron();
0036
0037
0038 Standard_EXPORT virtual ~V3d_Trihedron();
0039
0040
0041 bool IsWireframe() const { return myIsWireframe; }
0042
0043
0044 void SetWireframe (const Standard_Boolean theAsWireframe)
0045 {
0046 if (myIsWireframe != theAsWireframe)
0047 {
0048 invalidate();
0049 myIsWireframe = theAsWireframe;
0050 }
0051 }
0052
0053
0054 const Handle(Graphic3d_TransformPers) TransformPersistence() const { return myTransformPers; }
0055
0056
0057 Standard_EXPORT void SetPosition (const Aspect_TypeOfTriedronPosition thePosition);
0058
0059
0060 Standard_Real Scale() const { return myScale; }
0061
0062
0063 Standard_EXPORT void SetScale (const Standard_Real theScale);
0064
0065
0066 Standard_Real SizeRatio() const { return myRatio; }
0067
0068
0069 Standard_EXPORT void SetSizeRatio (const Standard_Real theRatio);
0070
0071
0072 Standard_Real ArrowDiameter() const { return myDiameter; }
0073
0074
0075 Standard_EXPORT void SetArrowDiameter (const Standard_Real theDiam);
0076
0077
0078 Standard_Integer NbFacets() const { return myNbFacettes; }
0079
0080
0081 Standard_EXPORT void SetNbFacets (const Standard_Integer theNbFacets);
0082
0083
0084
0085
0086 const Handle(Prs3d_TextAspect)& LabelAspect (V3d_TypeOfAxe theAxis) const { return myTextAspects[theAxis]; }
0087
0088
0089 Standard_EXPORT void SetLabelsColor (const Quantity_Color& theXColor,
0090 const Quantity_Color& theYColor,
0091 const Quantity_Color& theZColor);
0092
0093
0094 Standard_EXPORT void SetLabelsColor (const Quantity_Color& theColor);
0095
0096
0097
0098
0099 const Handle(Prs3d_ShadingAspect)& ArrowAspect (V3d_TypeOfAxe theAxis) const { return myArrowShadingAspects[theAxis]; }
0100
0101
0102 Standard_EXPORT void SetArrowsColor (const Quantity_Color& theXColor,
0103 const Quantity_Color& theYColor,
0104 const Quantity_Color& theZColor);
0105
0106
0107 const Handle(Prs3d_ShadingAspect)& OriginAspect() const { return mySphereShadingAspect; }
0108
0109
0110
0111
0112 const TCollection_AsciiString& Label (V3d_TypeOfAxe theAxis) const { return myLabels[theAxis]; }
0113
0114
0115 Standard_EXPORT void SetLabels (const TCollection_AsciiString& theX,
0116 const TCollection_AsciiString& theY,
0117 const TCollection_AsciiString& theZ);
0118
0119
0120 void Display (const Handle(V3d_View)& theView)
0121 {
0122 Display (*theView);
0123 }
0124
0125
0126 Standard_EXPORT void Display (const V3d_View& theView);
0127
0128
0129 Standard_EXPORT void Erase();
0130
0131
0132 Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0133
0134 protected:
0135
0136
0137 Standard_EXPORT void compute();
0138
0139
0140 void invalidate()
0141 {
0142 myToCompute = Standard_True;
0143 }
0144
0145
0146 Standard_EXPORT void setOffset2d();
0147
0148 private:
0149
0150
0151 class TrihedronStructure;
0152
0153 protected:
0154
0155 Handle(Prs3d_ShadingAspect) mySphereShadingAspect;
0156 Handle(Prs3d_TextAspect) myTextAspects[3];
0157 Handle(Prs3d_ShadingAspect) myArrowShadingAspects[3];
0158 TCollection_AsciiString myLabels[3];
0159
0160 Handle(Graphic3d_Structure) myStructure;
0161 Handle(Graphic3d_TransformPers) myTransformPers;
0162
0163 Standard_Real myScale;
0164 Standard_Real myRatio;
0165 Standard_Real myDiameter;
0166 Standard_Integer myNbFacettes;
0167 Standard_Boolean myIsWireframe;
0168 Standard_Boolean myToCompute;
0169
0170 };
0171
0172 DEFINE_STANDARD_HANDLE (V3d_Trihedron, Standard_Transient)
0173
0174 #endif