# Visualization
TKMeshVS
MeshVS

# MeshVS_NodalColorPrsBuilder Class Reference

This class provides methods to create presentation of nodes with assigned color.
There are two ways of presentation building
1. Without using texture.
In this case colors of nodes are specified with DataMapOfIntegerColor and presentation
is built with gradient fill between these nodes (default behaviour)
2. Using texture.
In this case presentation is built with spectrum filling between nodes. For example, if
one node has blue color and second one has violet color, parameters of this class may be
set to fill presentation between nodes with solar spectrum.
Methods:
UseTexture - activates/deactivates this way
SetColorMap - sets colors used for generation of texture
SetColorindices - specifies correspondence between node IDs and indices of colors from color map
.

`#include <MeshVS_NodalColorPrsBuilder.hxx>`

Inheritance diagram for MeshVS_NodalColorPrsBuilder:

[legend]

## Public Member Functions

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)
virtual Standard_EXPORT void | Build (const Handle(Prs3d_Presentation)&Prs, const TColStd_PackedMapOfInteger &IDs, TColStd_PackedMapOfInteger &IDsToExclude, const Standard_Boolean IsElement, const Standard_Integer DisplayMode) const
| Builds presentation of nodes with assigned color. .
Standard_EXPORT const MeshVS_DataMapOfIntegerColor & | GetColors () const
| Returns map of colors assigned to nodes. .
Standard_EXPORT void | SetColors (const MeshVS_DataMapOfIntegerColor &Map)
| Sets map of colors assigned to nodes. .
Standard_EXPORT Standard_Boolean | HasColors () const
| Returns true, if map isn't empty .
Standard_EXPORT Standard_Boolean | GetColor (const Standard_Integer ID, Quantity_Color &theColor) const
| Returns color assigned to single node .
Standard_EXPORT void | SetColor (const Standard_Integer ID, const Quantity_Color &theColor)
| Sets color assigned to single node .
Standard_EXPORT void | UseTexture (const Standard_Boolean theToUse)
| Specify whether texture must be used to build presentation .
Standard_EXPORT Standard_Boolean | IsUseTexture () const
| Verify whether texture is used to build presentation .
Standard_EXPORT void | SetColorMap (const Aspect_SequenceOfColor &theColors)
| Set colors to be used for texrture presentation theColors - colors for valid coordinates (laying in range [0, 1]) .
Standard_EXPORT const Aspect_SequenceOfColor & | GetColorMap () const
| Return colors used for texrture presentation .
Standard_EXPORT void | SetInvalidColor (const Quantity_Color &theInvalidColor)
| Set color representing invalid texture coordinate (laying outside range [0, 1]) .
Standard_EXPORT Quantity_Color | GetInvalidColor () const
| Return color representing invalid texture coordinate (laying outside range [0, 1]) .
Standard_EXPORT void | SetTextureCoords (const TColStd_DataMapOfIntegerReal &theMap)
| Specify correspondence between node IDs and texture coordinates (range [0, 1]) .
Standard_EXPORT const TColStd_DataMapOfIntegerReal & | GetTextureCoords () const
| Get correspondence between node IDs and texture coordinates (range [0, 1]) .
Standard_EXPORT void | SetTextureCoord (const Standard_Integer theID, const Standard_Real theCoord)
| Specify correspondence between node ID and texture coordinate (range [0, 1]) .
Standard_EXPORT Standard_Real | GetTextureCoord (const Standard_Integer theID)
| Return correspondence between node IDs and texture coordinate (range [0, 1]) .
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Private Member Functions

Standard_EXPORT Handle_Graphic3d_Texture2D | CreateTexture () const
| Create texture in accordance with myTextureColorMap .

## Private Attributes

MeshVS_DataMapOfIntegerColor | myNodeColorMap
Standard_Boolean | myUseTexture
Aspect_SequenceOfColor | myTextureColorMap
TColStd_DataMapOfIntegerReal | myTextureCoords
Quantity_Color | myInvalidColor

## Constructor & Destructor Documentation

Standard_EXPORT MeshVS_NodalColorPrsBuilder::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`
| ) |

## Member Function Documentation

virtual Standard_EXPORT void MeshVS_NodalColorPrsBuilder::Build | ( | const Handle(Prs3d_Presentation)& | Prs,
|  | const TColStd_PackedMapOfInteger & | IDs,
|  | TColStd_PackedMapOfInteger & | IDsToExclude,
|  | const Standard_Boolean | IsElement,
|  | const Standard_Integer | DisplayMode
| ) | const`[virtual]`

| Implements MeshVS_PrsBuilder.

Standard_EXPORT Handle_Graphic3d_Texture2D MeshVS_NodalColorPrsBuilder::CreateTexture | ( |  | ) | const`[private]`

Standard_EXPORT Standard_Boolean MeshVS_NodalColorPrsBuilder::GetColor | ( | const Standard_Integer | ID,
|  | Quantity_Color & | theColor
| ) | const

Standard_EXPORT const Aspect_SequenceOfColor& MeshVS_NodalColorPrsBuilder::GetColorMap | ( |  | ) | const

Standard_EXPORT const MeshVS_DataMapOfIntegerColor& MeshVS_NodalColorPrsBuilder::GetColors | ( |  | ) | const

Standard_EXPORT Quantity_Color MeshVS_NodalColorPrsBuilder::GetInvalidColor | ( |  | ) | const

Standard_EXPORT Standard_Real MeshVS_NodalColorPrsBuilder::GetTextureCoord | ( | const Standard_Integer | theID | ) |

Standard_EXPORT const TColStd_DataMapOfIntegerReal& MeshVS_NodalColorPrsBuilder::GetTextureCoords | ( |  | ) | const

Standard_EXPORT const MeshVS_NodalColorPrsBuilder::Handle | ( | Standard_Type |  | ) | const

| Reimplemented from MeshVS_PrsBuilder.

Standard_EXPORT Standard_Boolean MeshVS_NodalColorPrsBuilder::HasColors | ( |  | ) | const

Standard_EXPORT Standard_Boolean MeshVS_NodalColorPrsBuilder::IsUseTexture | ( |  | ) | const

Standard_EXPORT void MeshVS_NodalColorPrsBuilder::SetColor | ( | const Standard_Integer | ID,
|  | const Quantity_Color & | theColor
| ) |

Standard_EXPORT void MeshVS_NodalColorPrsBuilder::SetColorMap | ( | const Aspect_SequenceOfColor & | theColors | ) |

Standard_EXPORT void MeshVS_NodalColorPrsBuilder::SetColors | ( | const MeshVS_DataMapOfIntegerColor & | Map | ) |

Standard_EXPORT void MeshVS_NodalColorPrsBuilder::SetInvalidColor | ( | const Quantity_Color & | theInvalidColor | ) |

Standard_EXPORT void MeshVS_NodalColorPrsBuilder::SetTextureCoord | ( | const Standard_Integer | theID,
|  | const Standard_Real | theCoord
| ) |

Standard_EXPORT void MeshVS_NodalColorPrsBuilder::SetTextureCoords | ( | const TColStd_DataMapOfIntegerReal & | theMap | ) |

Standard_EXPORT void MeshVS_NodalColorPrsBuilder::UseTexture | ( | const Standard_Boolean | theToUse | ) |

## Field Documentation

Quantity_Color MeshVS_NodalColorPrsBuilder::myInvalidColor `[private]`

MeshVS_DataMapOfIntegerColor MeshVS_NodalColorPrsBuilder::myNodeColorMap `[private]`

Aspect_SequenceOfColor MeshVS_NodalColorPrsBuilder::myTextureColorMap `[private]`

TColStd_DataMapOfIntegerReal MeshVS_NodalColorPrsBuilder::myTextureCoords `[private]`

Standard_Boolean MeshVS_NodalColorPrsBuilder::myUseTexture `[private]`

The documentation for this class was generated from the following file:

- MeshVS_NodalColorPrsBuilder.hxx