File indexing completed on 2025-01-18 10:04:16
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 <MeshVS_DataMapOfIntegerColor.hxx>
0020 #include <Aspect_SequenceOfColor.hxx>
0021 #include <TColStd_DataMapOfIntegerReal.hxx>
0022 #include <Quantity_Color.hxx>
0023 #include <MeshVS_PrsBuilder.hxx>
0024 #include <MeshVS_DisplayModeFlags.hxx>
0025 #include <MeshVS_BuilderPriority.hxx>
0026 #include <TColStd_PackedMapOfInteger.hxx>
0027 #include <MeshVS_HArray1OfSequenceOfInteger.hxx>
0028 #include <TColStd_Array1OfInteger.hxx>
0029 #include <TColStd_Array1OfReal.hxx>
0030
0031 class MeshVS_Mesh;
0032 class MeshVS_DataSource;
0033 class Graphic3d_Texture2D;
0034 class Graphic3d_ArrayOfPrimitives;
0035
0036 DEFINE_STANDARD_HANDLE(MeshVS_NodalColorPrsBuilder, MeshVS_PrsBuilder)
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 class MeshVS_NodalColorPrsBuilder : public MeshVS_PrsBuilder
0052 {
0053
0054 public:
0055
0056
0057 Standard_EXPORT MeshVS_NodalColorPrsBuilder(const Handle(MeshVS_Mesh)& Parent, const MeshVS_DisplayModeFlags& Flags = MeshVS_DMF_NodalColorDataPrs, const Handle(MeshVS_DataSource)& DS = 0, const Standard_Integer Id = -1, const MeshVS_BuilderPriority& Priority = MeshVS_BP_NodalColor);
0058
0059
0060 Standard_EXPORT virtual void Build (const Handle(Prs3d_Presentation)& Prs, const TColStd_PackedMapOfInteger& IDs, TColStd_PackedMapOfInteger& IDsToExclude, const Standard_Boolean IsElement, const Standard_Integer DisplayMode) const Standard_OVERRIDE;
0061
0062
0063 Standard_EXPORT const MeshVS_DataMapOfIntegerColor& GetColors() const;
0064
0065
0066 Standard_EXPORT void SetColors (const MeshVS_DataMapOfIntegerColor& Map);
0067
0068
0069 Standard_EXPORT Standard_Boolean HasColors() const;
0070
0071
0072 Standard_EXPORT Standard_Boolean GetColor (const Standard_Integer ID, Quantity_Color& theColor) const;
0073
0074
0075 Standard_EXPORT void SetColor (const Standard_Integer ID, const Quantity_Color& theColor);
0076
0077
0078 Standard_EXPORT void UseTexture (const Standard_Boolean theToUse);
0079
0080
0081 Standard_EXPORT Standard_Boolean IsUseTexture() const;
0082
0083
0084
0085 Standard_EXPORT void SetColorMap (const Aspect_SequenceOfColor& theColors);
0086
0087
0088 Standard_EXPORT const Aspect_SequenceOfColor& GetColorMap() const;
0089
0090
0091
0092 Standard_EXPORT void SetInvalidColor (const Quantity_Color& theInvalidColor);
0093
0094
0095
0096 Standard_EXPORT Quantity_Color GetInvalidColor() const;
0097
0098
0099 Standard_EXPORT void SetTextureCoords (const TColStd_DataMapOfIntegerReal& theMap);
0100
0101
0102 Standard_EXPORT const TColStd_DataMapOfIntegerReal& GetTextureCoords() const;
0103
0104
0105 Standard_EXPORT void SetTextureCoord (const Standard_Integer theID, const Standard_Real theCoord);
0106
0107
0108 Standard_EXPORT Standard_Real GetTextureCoord (const Standard_Integer theID);
0109
0110
0111 Standard_EXPORT void AddVolumePrs (const Handle(MeshVS_HArray1OfSequenceOfInteger)& theTopo, const TColStd_Array1OfInteger& theNodes, const TColStd_Array1OfReal& theCoords, const Handle(Graphic3d_ArrayOfPrimitives)& theArray, const Standard_Boolean theIsShaded, const Standard_Integer theNbColors, const Standard_Integer theNbTexColors, const Standard_Real theColorRatio) const;
0112
0113
0114
0115
0116 DEFINE_STANDARD_RTTIEXT(MeshVS_NodalColorPrsBuilder,MeshVS_PrsBuilder)
0117
0118 protected:
0119
0120
0121
0122
0123 private:
0124
0125
0126
0127 Standard_EXPORT Handle(Graphic3d_Texture2D) CreateTexture() const;
0128
0129 MeshVS_DataMapOfIntegerColor myNodeColorMap;
0130 Standard_Boolean myUseTexture;
0131 Aspect_SequenceOfColor myTextureColorMap;
0132 TColStd_DataMapOfIntegerReal myTextureCoords;
0133 Quantity_Color myInvalidColor;
0134
0135
0136 };
0137
0138
0139
0140
0141
0142
0143
0144 #endif