0030675: Visualization - remove redundant proxy classes in hierarchy of PrsMgr_Presen...
[occt.git] / src / MeshVS / MeshVS_ElementalColorPrsBuilder.hxx
CommitLineData
42cf5bc1 1// Created on: 2003-11-12
2// Created by: Alexander SOLOVYOV
3// Copyright (c) 2003-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _MeshVS_ElementalColorPrsBuilder_HeaderFile
17#define _MeshVS_ElementalColorPrsBuilder_HeaderFile
18
42cf5bc1 19#include <MeshVS_DataMapOfIntegerColor.hxx>
20#include <MeshVS_DataMapOfIntegerTwoColors.hxx>
21#include <MeshVS_PrsBuilder.hxx>
22#include <MeshVS_DisplayModeFlags.hxx>
42cf5bc1 23#include <MeshVS_BuilderPriority.hxx>
42cf5bc1 24#include <MeshVS_TwoColors.hxx>
7dd7c146 25
42cf5bc1 26class MeshVS_Mesh;
27class MeshVS_DataSource;
42cf5bc1 28class Quantity_Color;
29
30
31class MeshVS_ElementalColorPrsBuilder;
32DEFINE_STANDARD_HANDLE(MeshVS_ElementalColorPrsBuilder, MeshVS_PrsBuilder)
33
34//! This class provides methods to create presentation of elements with
35//! assigned colors. The class contains two color maps: map of same colors for front
36//! and back side of face and map of different ones,
37class MeshVS_ElementalColorPrsBuilder : public MeshVS_PrsBuilder
38{
39
40public:
41
42
43 //! Constructor
44 Standard_EXPORT MeshVS_ElementalColorPrsBuilder(const Handle(MeshVS_Mesh)& Parent, const MeshVS_DisplayModeFlags& Flags = MeshVS_DMF_ElementalColorDataPrs, const Handle(MeshVS_DataSource)& DS = 0, const Standard_Integer Id = -1, const MeshVS_BuilderPriority& Priority = MeshVS_BP_ElemColor);
45
46 //! Builds presentation of elements with assigned colors.
79104795 47 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;
42cf5bc1 48
49 //! Returns map of colors same for front and back side of face.
50 Standard_EXPORT const MeshVS_DataMapOfIntegerColor& GetColors1() const;
51
52 //! Sets map of colors same for front and back side of face.
53 Standard_EXPORT void SetColors1 (const MeshVS_DataMapOfIntegerColor& Map);
54
55 //! Returns true, if map of colors isn't empty
56 Standard_EXPORT Standard_Boolean HasColors1() const;
57
58 //! Returns color assigned with element number ID
59 Standard_EXPORT Standard_Boolean GetColor1 (const Standard_Integer ID, Quantity_Color& theColor) const;
60
61 //! Sets color assigned with element number ID
62 Standard_EXPORT void SetColor1 (const Standard_Integer ID, const Quantity_Color& theColor);
63
64 //! Returns map of different colors for front and back side of face
65 Standard_EXPORT const MeshVS_DataMapOfIntegerTwoColors& GetColors2() const;
66
67 //! Sets map of different colors for front and back side of face
68 Standard_EXPORT void SetColors2 (const MeshVS_DataMapOfIntegerTwoColors& Map);
69
70 //! Returns true, if map isn't empty
71 Standard_EXPORT Standard_Boolean HasColors2() const;
72
73 //! Returns colors assigned with element number ID
74 Standard_EXPORT Standard_Boolean GetColor2 (const Standard_Integer ID, MeshVS_TwoColors& theColor) const;
75
76 //! Returns colors assigned with element number ID
77 //! theColor1 is the front element color
78 //! theColor2 is the back element color
79 Standard_EXPORT Standard_Boolean GetColor2 (const Standard_Integer ID, Quantity_Color& theColor1, Quantity_Color& theColor2) const;
80
81 //! Sets colors assigned with element number ID
82 Standard_EXPORT void SetColor2 (const Standard_Integer ID, const MeshVS_TwoColors& theTwoColors);
83
84 //! Sets color assigned with element number ID
85 //! theColor1 is the front element color
86 //! theColor2 is the back element color
87 Standard_EXPORT void SetColor2 (const Standard_Integer ID, const Quantity_Color& theColor1, const Quantity_Color& theColor2);
88
89
90
91
92efcf78 92 DEFINE_STANDARD_RTTIEXT(MeshVS_ElementalColorPrsBuilder,MeshVS_PrsBuilder)
42cf5bc1 93
94protected:
95
96
97
98
99private:
100
101
102 MeshVS_DataMapOfIntegerColor myElemColorMap1;
103 MeshVS_DataMapOfIntegerTwoColors myElemColorMap2;
104
105
106};
107
108
109
110
111
112
113
114#endif // _MeshVS_ElementalColorPrsBuilder_HeaderFile