File indexing completed on 2026-12-03 10:55:49
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _MeshVS_NodalColorPrsBuilder_HeaderFile
0017 #define _MeshVS_NodalColorPrsBuilder_HeaderFile
0018
0019 #include <Standard_Integer.hxx>
0020 #include <Quantity_Color.hxx>
0021 #include <NCollection_DataMap.hxx>
0022 #include <NCollection_Sequence.hxx>
0023 #include <MeshVS_PrsBuilder.hxx>
0024 #include <MeshVS_DisplayModeFlags.hxx>
0025 #include <MeshVS_BuilderPriority.hxx>
0026 #include <TColStd_PackedMapOfInteger.hxx>
0027 #include <NCollection_Array1.hxx>
0028 #include <NCollection_HArray1.hxx>
0029
0030 class MeshVS_Mesh;
0031 class MeshVS_DataSource;
0032 class Graphic3d_Texture2D;
0033 class Graphic3d_ArrayOfPrimitives;
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 class MeshVS_NodalColorPrsBuilder : public MeshVS_PrsBuilder
0049 {
0050
0051 public:
0052 Standard_EXPORT MeshVS_NodalColorPrsBuilder(
0053 const occ::handle<MeshVS_Mesh>& Parent,
0054 const MeshVS_DisplayModeFlags& Flags = MeshVS_DMF_NodalColorDataPrs,
0055 const occ::handle<MeshVS_DataSource>& DS = nullptr,
0056 const int Id = -1,
0057 const MeshVS_BuilderPriority& Priority = MeshVS_BP_NodalColor);
0058
0059
0060 Standard_EXPORT void Build(const occ::handle<Prs3d_Presentation>& Prs,
0061 const TColStd_PackedMapOfInteger& IDs,
0062 TColStd_PackedMapOfInteger& IDsToExclude,
0063 const bool IsElement,
0064 const int DisplayMode) const override;
0065
0066
0067 Standard_EXPORT const NCollection_DataMap<int, Quantity_Color>& GetColors() const;
0068
0069
0070 Standard_EXPORT void SetColors(const NCollection_DataMap<int, Quantity_Color>& Map);
0071
0072
0073 Standard_EXPORT bool HasColors() const;
0074
0075
0076 Standard_EXPORT bool GetColor(const int ID, Quantity_Color& theColor) const;
0077
0078
0079 Standard_EXPORT void SetColor(const int ID, const Quantity_Color& theColor);
0080
0081
0082 Standard_EXPORT void UseTexture(const bool theToUse);
0083
0084
0085 Standard_EXPORT bool IsUseTexture() const;
0086
0087
0088
0089 Standard_EXPORT void SetColorMap(const NCollection_Sequence<Quantity_Color>& theColors);
0090
0091
0092 Standard_EXPORT const NCollection_Sequence<Quantity_Color>& GetColorMap() const;
0093
0094
0095
0096 Standard_EXPORT void SetInvalidColor(const Quantity_Color& theInvalidColor);
0097
0098
0099
0100 Standard_EXPORT Quantity_Color GetInvalidColor() const;
0101
0102
0103 Standard_EXPORT void SetTextureCoords(const NCollection_DataMap<int, double>& theMap);
0104
0105
0106 Standard_EXPORT const NCollection_DataMap<int, double>& GetTextureCoords() const;
0107
0108
0109 Standard_EXPORT void SetTextureCoord(const int theID, const double theCoord);
0110
0111
0112 Standard_EXPORT double GetTextureCoord(const int theID);
0113
0114
0115 Standard_EXPORT void AddVolumePrs(
0116 const occ::handle<NCollection_HArray1<NCollection_Sequence<int>>>& theTopo,
0117 const NCollection_Array1<int>& theNodes,
0118 const NCollection_Array1<double>& theCoords,
0119 const occ::handle<Graphic3d_ArrayOfPrimitives>& theArray,
0120 const bool theIsShaded,
0121 const int theNbColors,
0122 const int theNbTexColors,
0123 const double theColorRatio) const;
0124
0125 DEFINE_STANDARD_RTTIEXT(MeshVS_NodalColorPrsBuilder, MeshVS_PrsBuilder)
0126
0127 private:
0128
0129 Standard_EXPORT occ::handle<Graphic3d_Texture2D> CreateTexture() const;
0130
0131 NCollection_DataMap<int, Quantity_Color> myNodeColorMap;
0132 bool myUseTexture;
0133 NCollection_Sequence<Quantity_Color> myTextureColorMap;
0134 NCollection_DataMap<int, double> myTextureCoords;
0135 Quantity_Color myInvalidColor;
0136 };
0137
0138 #endif