1 // Created on: 2003-10-13
2 // Created by: Alexander SOLOVYOV
3 // Copyright (c) 2003-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _MeshVS_TextPrsBuilder_HeaderFile
17 #define _MeshVS_TextPrsBuilder_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <MeshVS_DataMapOfIntegerAsciiString.hxx>
23 #include <MeshVS_PrsBuilder.hxx>
24 #include <Standard_Real.hxx>
25 #include <MeshVS_DisplayModeFlags.hxx>
26 #include <Standard_Integer.hxx>
27 #include <MeshVS_BuilderPriority.hxx>
28 #include <TColStd_PackedMapOfInteger.hxx>
29 #include <Standard_Boolean.hxx>
32 class MeshVS_DataSource;
33 class Prs3d_Presentation;
34 class TCollection_AsciiString;
37 class MeshVS_TextPrsBuilder;
38 DEFINE_STANDARD_HANDLE(MeshVS_TextPrsBuilder, MeshVS_PrsBuilder)
40 //! This class provides methods to create text data presentation.
41 //! It store map of texts assigned with nodes or elements.
42 class MeshVS_TextPrsBuilder : public MeshVS_PrsBuilder
48 Standard_EXPORT MeshVS_TextPrsBuilder(const Handle(MeshVS_Mesh)& Parent, const Standard_Real Height, const Quantity_Color& Color, const MeshVS_DisplayModeFlags& Flags = MeshVS_DMF_TextDataPrs, const Handle(MeshVS_DataSource)& DS = 0, const Standard_Integer Id = -1, const MeshVS_BuilderPriority& Priority = MeshVS_BP_Text);
50 //! Builds presentation of text data
51 Standard_EXPORT virtual void Build (const Handle(Prs3d_Presentation)& Prs, const TColStd_PackedMapOfInteger& IDs, TColStd_PackedMapOfInteger& IDsToExclude, const Standard_Boolean IsElement, const Standard_Integer theDisplayMode) const Standard_OVERRIDE;
53 //! Returns map of text assigned with nodes ( IsElement = False ) or elements ( IsElement = True )
54 Standard_EXPORT const MeshVS_DataMapOfIntegerAsciiString& GetTexts (const Standard_Boolean IsElement) const;
56 //! Sets map of text assigned with nodes or elements
57 Standard_EXPORT void SetTexts (const Standard_Boolean IsElement, const MeshVS_DataMapOfIntegerAsciiString& Map);
59 //! Returns True if map isn't empty
60 Standard_EXPORT Standard_Boolean HasTexts (const Standard_Boolean IsElement) const;
62 //! Returns text assigned with single node or element
63 Standard_EXPORT Standard_Boolean GetText (const Standard_Boolean IsElement, const Standard_Integer ID, TCollection_AsciiString& Text) const;
65 //! Sets text assigned with single node or element
66 Standard_EXPORT void SetText (const Standard_Boolean IsElement, const Standard_Integer ID, const TCollection_AsciiString& Text);
71 DEFINE_STANDARD_RTTI(MeshVS_TextPrsBuilder,MeshVS_PrsBuilder)
81 MeshVS_DataMapOfIntegerAsciiString myNodeTextMap;
82 MeshVS_DataMapOfIntegerAsciiString myElemTextMap;
93 #endif // _MeshVS_TextPrsBuilder_HeaderFile