File indexing completed on 2026-09-20 09:18:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _MeshVS_VectorPrsBuilder_HeaderFile
0017 #define _MeshVS_VectorPrsBuilder_HeaderFile
0018
0019 #include <Standard_Integer.hxx>
0020 #include <gp_Vec.hxx>
0021 #include <NCollection_DataMap.hxx>
0022 #include <MeshVS_PrsBuilder.hxx>
0023 #include <MeshVS_DisplayModeFlags.hxx>
0024 #include <MeshVS_BuilderPriority.hxx>
0025 #include <gp_Pnt.hxx>
0026 #include <NCollection_Array1.hxx>
0027
0028 class MeshVS_Mesh;
0029 class Quantity_Color;
0030 class MeshVS_DataSource;
0031 class gp_Trsf;
0032 class Graphic3d_ArrayOfPrimitives;
0033 class gp_Vec;
0034
0035
0036
0037
0038 class MeshVS_VectorPrsBuilder : public MeshVS_PrsBuilder
0039 {
0040
0041 public:
0042 Standard_EXPORT MeshVS_VectorPrsBuilder(
0043 const occ::handle<MeshVS_Mesh>& Parent,
0044 const double MaxLength,
0045 const Quantity_Color& VectorColor,
0046 const MeshVS_DisplayModeFlags& Flags = MeshVS_DMF_VectorDataPrs,
0047 const occ::handle<MeshVS_DataSource>& DS = nullptr,
0048 const int Id = -1,
0049 const MeshVS_BuilderPriority& Priority = MeshVS_BP_Vector,
0050 const bool IsSimplePrs = false);
0051
0052
0053 Standard_EXPORT void Build(const occ::handle<Prs3d_Presentation>& Prs,
0054 const TColStd_PackedMapOfInteger& IDs,
0055 TColStd_PackedMapOfInteger& IDsToExclude,
0056 const bool IsElement,
0057 const int theDisplayMode) const override;
0058
0059
0060 Standard_EXPORT void DrawVector(const gp_Trsf& theTrsf,
0061 const double Length,
0062 const double MaxLength,
0063 const NCollection_Array1<gp_Pnt>& ArrowPoints,
0064 const occ::handle<Graphic3d_ArrayOfPrimitives>& Lines,
0065 const occ::handle<Graphic3d_ArrayOfPrimitives>& ArrowLines,
0066 const occ::handle<Graphic3d_ArrayOfPrimitives>& Triangles) const;
0067
0068
0069 Standard_EXPORT static double calculateArrow(NCollection_Array1<gp_Pnt>& Points,
0070 const double Length,
0071 const double ArrowPart);
0072
0073
0074 Standard_EXPORT const NCollection_DataMap<int, gp_Vec>& GetVectors(const bool IsElement) const;
0075
0076
0077 Standard_EXPORT void SetVectors(const bool IsElement,
0078 const NCollection_DataMap<int, gp_Vec>& Map);
0079
0080
0081 Standard_EXPORT bool HasVectors(const bool IsElement) const;
0082
0083
0084 Standard_EXPORT bool GetVector(const bool IsElement, const int ID, gp_Vec& Vect) const;
0085
0086
0087 Standard_EXPORT void SetVector(const bool IsElement, const int ID, const gp_Vec& Vect);
0088
0089
0090
0091 Standard_EXPORT void GetMinMaxVectorValue(const bool IsElement,
0092 double& MinValue,
0093 double& MaxValue) const;
0094
0095
0096
0097 Standard_EXPORT void SetSimplePrsMode(const bool IsSimpleArrow);
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107 Standard_EXPORT void SetSimplePrsParams(const double theLineWidthParam,
0108 const double theStartParam,
0109 const double theEndParam);
0110
0111 DEFINE_STANDARD_RTTIEXT(MeshVS_VectorPrsBuilder, MeshVS_PrsBuilder)
0112
0113 private:
0114 bool myIsSimplePrs;
0115 double mySimpleWidthPrm;
0116 double mySimpleStartPrm;
0117 double mySimpleEndPrm;
0118 NCollection_DataMap<int, gp_Vec> myNodeVectorMap;
0119 NCollection_DataMap<int, gp_Vec> myElemVectorMap;
0120 };
0121
0122 #endif