1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to
// this header file considered to be the "object code" form of the original source.
#ifndef _MeshVS_NodalColorPrsBuilder_HeaderFile
#define _MeshVS_NodalColorPrsBuilder_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_MeshVS_NodalColorPrsBuilder_HeaderFile
#include <Handle_MeshVS_NodalColorPrsBuilder.hxx>
#endif
#ifndef _MeshVS_DataMapOfIntegerColor_HeaderFile
#include <MeshVS_DataMapOfIntegerColor.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Aspect_SequenceOfColor_HeaderFile
#include <Aspect_SequenceOfColor.hxx>
#endif
#ifndef _TColStd_DataMapOfIntegerReal_HeaderFile
#include <TColStd_DataMapOfIntegerReal.hxx>
#endif
#ifndef _Quantity_Color_HeaderFile
#include <Quantity_Color.hxx>
#endif
#ifndef _MeshVS_PrsBuilder_HeaderFile
#include <MeshVS_PrsBuilder.hxx>
#endif
#ifndef _Handle_MeshVS_Mesh_HeaderFile
#include <Handle_MeshVS_Mesh.hxx>
#endif
#ifndef _MeshVS_DisplayModeFlags_HeaderFile
#include <MeshVS_DisplayModeFlags.hxx>
#endif
#ifndef _Handle_MeshVS_DataSource_HeaderFile
#include <Handle_MeshVS_DataSource.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _MeshVS_BuilderPriority_HeaderFile
#include <MeshVS_BuilderPriority.hxx>
#endif
#ifndef _Handle_Prs3d_Presentation_HeaderFile
#include <Handle_Prs3d_Presentation.hxx>
#endif
#ifndef _TColStd_PackedMapOfInteger_HeaderFile
#include <TColStd_PackedMapOfInteger.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Handle_Graphic3d_Texture2D_HeaderFile
#include <Handle_Graphic3d_Texture2D.hxx>
#endif
class MeshVS_Mesh;
class MeshVS_DataSource;
class Prs3d_Presentation;
class MeshVS_DataMapOfIntegerColor;
class Quantity_Color;
class Aspect_SequenceOfColor;
class TColStd_DataMapOfIntegerReal;
class Graphic3d_Texture2D;
//! This class provides methods to create presentation of nodes with assigned color. <br>
//! There are two ways of presentation building <br>
//! 1. Without using texture. <br>
//! In this case colors of nodes are specified with DataMapOfIntegerColor and presentation <br>
//! is built with gradient fill between these nodes (default behaviour) <br>
//! 2. Using texture. <br>
//! In this case presentation is built with spectrum filling between nodes. For example, if <br>
//! one node has blue color and second one has violet color, parameters of this class may be <br>
//! set to fill presentation between nodes with solar spectrum. <br>
//! Methods: <br>
//! UseTexture - activates/deactivates this way <br>
//! SetColorMap - sets colors used for generation of texture <br>
//! SetColorindices - specifies correspondence between node IDs and indices of colors from color map <br>
class MeshVS_NodalColorPrsBuilder : public MeshVS_PrsBuilder {
public:
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);
//! Builds presentation of nodes with assigned color. <br>
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;
//! Returns map of colors assigned to nodes. <br>
Standard_EXPORT const MeshVS_DataMapOfIntegerColor& GetColors() const;
//! Sets map of colors assigned to nodes. <br>
Standard_EXPORT void SetColors(const MeshVS_DataMapOfIntegerColor& Map) ;
//! Returns true, if map isn't empty <br>
Standard_EXPORT Standard_Boolean HasColors() const;
//! Returns color assigned to single node <br>
Standard_EXPORT Standard_Boolean GetColor(const Standard_Integer ID,Quantity_Color& theColor) const;
//! Sets color assigned to single node <br>
Standard_EXPORT void SetColor(const Standard_Integer ID,const Quantity_Color& theColor) ;
//! Specify whether texture must be used to build presentation <br>
Standard_EXPORT void UseTexture(const Standard_Boolean theToUse) ;
//! Verify whether texture is used to build presentation <br>
Standard_EXPORT Standard_Boolean IsUseTexture() const;
//! Set colors to be used for texrture presentation <br>
//! theColors - colors for valid coordinates (laying in range [0, 1]) <br>
Standard_EXPORT void SetColorMap(const Aspect_SequenceOfColor& theColors) ;
//! Return colors used for texrture presentation <br>
Standard_EXPORT const Aspect_SequenceOfColor& GetColorMap() const;
//! Set color representing invalid texture coordinate <br>
//! (laying outside range [0, 1]) <br>
Standard_EXPORT void SetInvalidColor(const Quantity_Color& theInvalidColor) ;
//! Return color representing invalid texture coordinate <br>
//! (laying outside range [0, 1]) <br>
Standard_EXPORT Quantity_Color GetInvalidColor() const;
//! Specify correspondence between node IDs and texture coordinates (range [0, 1]) <br>
Standard_EXPORT void SetTextureCoords(const TColStd_DataMapOfIntegerReal& theMap) ;
//! Get correspondence between node IDs and texture coordinates (range [0, 1]) <br>
Standard_EXPORT const TColStd_DataMapOfIntegerReal& GetTextureCoords() const;
//! Specify correspondence between node ID and texture coordinate (range [0, 1]) <br>
Standard_EXPORT void SetTextureCoord(const Standard_Integer theID,const Standard_Real theCoord) ;
//! Return correspondence between node IDs and texture coordinate (range [0, 1]) <br>
Standard_EXPORT Standard_Real GetTextureCoord(const Standard_Integer theID) ;
DEFINE_STANDARD_RTTI(MeshVS_NodalColorPrsBuilder)
protected:
private:
//! Create texture in accordance with myTextureColorMap <br>
Standard_EXPORT Handle_Graphic3d_Texture2D CreateTexture() const;
MeshVS_DataMapOfIntegerColor myNodeColorMap;
Standard_Boolean myUseTexture;
Aspect_SequenceOfColor myTextureColorMap;
TColStd_DataMapOfIntegerReal myTextureCoords;
Quantity_Color myInvalidColor;
};
// other Inline functions and methods (like "C++: function call" methods)
#endif
|