Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:15

0001 // Created on: 2003-11-12
0002 // Created by: Alexander SOLOVYOV
0003 // Copyright (c) 2003-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _MeshVS_ElementalColorPrsBuilder_HeaderFile
0017 #define _MeshVS_ElementalColorPrsBuilder_HeaderFile
0018 
0019 #include <MeshVS_DataMapOfIntegerColor.hxx>
0020 #include <MeshVS_DataMapOfIntegerTwoColors.hxx>
0021 #include <MeshVS_PrsBuilder.hxx>
0022 #include <MeshVS_DisplayModeFlags.hxx>
0023 #include <MeshVS_BuilderPriority.hxx>
0024 #include <MeshVS_TwoColors.hxx>
0025 
0026 class MeshVS_Mesh;
0027 class MeshVS_DataSource;
0028 class Quantity_Color;
0029 
0030 
0031 class MeshVS_ElementalColorPrsBuilder;
0032 DEFINE_STANDARD_HANDLE(MeshVS_ElementalColorPrsBuilder, MeshVS_PrsBuilder)
0033 
0034 //! This class provides methods to create presentation of elements with
0035 //! assigned colors. The class contains two color maps: map of same colors for front
0036 //! and back side of face and map of different ones,
0037 class MeshVS_ElementalColorPrsBuilder : public MeshVS_PrsBuilder
0038 {
0039 
0040 public:
0041 
0042   
0043   //! Constructor
0044   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);
0045   
0046   //! Builds presentation of elements with assigned colors.
0047   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;
0048   
0049   //! Returns map of colors same for front and back side of face.
0050   Standard_EXPORT const MeshVS_DataMapOfIntegerColor& GetColors1() const;
0051   
0052   //! Sets map of colors same for front and back side of face.
0053   Standard_EXPORT void SetColors1 (const MeshVS_DataMapOfIntegerColor& Map);
0054   
0055   //! Returns true, if map of colors isn't empty
0056   Standard_EXPORT Standard_Boolean HasColors1() const;
0057   
0058   //! Returns color assigned with element number ID
0059   Standard_EXPORT Standard_Boolean GetColor1 (const Standard_Integer ID, Quantity_Color& theColor) const;
0060   
0061   //! Sets color assigned with element number ID
0062   Standard_EXPORT void SetColor1 (const Standard_Integer ID, const Quantity_Color& theColor);
0063   
0064   //! Returns map of different colors for front and back side of face
0065   Standard_EXPORT const MeshVS_DataMapOfIntegerTwoColors& GetColors2() const;
0066   
0067   //! Sets map of different colors for front and back side of face
0068   Standard_EXPORT void SetColors2 (const MeshVS_DataMapOfIntegerTwoColors& Map);
0069   
0070   //! Returns true, if map isn't empty
0071   Standard_EXPORT Standard_Boolean HasColors2() const;
0072   
0073   //! Returns colors assigned with element number ID
0074   Standard_EXPORT Standard_Boolean GetColor2 (const Standard_Integer ID, MeshVS_TwoColors& theColor) const;
0075   
0076   //! Returns colors assigned with element number ID
0077   //! theColor1 is the front element color
0078   //! theColor2 is the back element color
0079   Standard_EXPORT Standard_Boolean GetColor2 (const Standard_Integer ID, Quantity_Color& theColor1, Quantity_Color& theColor2) const;
0080   
0081   //! Sets colors assigned with element number ID
0082   Standard_EXPORT void SetColor2 (const Standard_Integer ID, const MeshVS_TwoColors& theTwoColors);
0083   
0084   //! Sets color assigned with element number ID
0085   //! theColor1 is the front element color
0086   //! theColor2 is the back element color
0087   Standard_EXPORT void SetColor2 (const Standard_Integer ID, const Quantity_Color& theColor1, const Quantity_Color& theColor2);
0088 
0089 
0090 
0091 
0092   DEFINE_STANDARD_RTTIEXT(MeshVS_ElementalColorPrsBuilder,MeshVS_PrsBuilder)
0093 
0094 protected:
0095 
0096 
0097 
0098 
0099 private:
0100 
0101 
0102   MeshVS_DataMapOfIntegerColor myElemColorMap1;
0103   MeshVS_DataMapOfIntegerTwoColors myElemColorMap2;
0104 
0105 
0106 };
0107 
0108 
0109 
0110 
0111 
0112 
0113 
0114 #endif // _MeshVS_ElementalColorPrsBuilder_HeaderFile