Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/MeshVS_TextPrsBuilder.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created on: 2003-10-13
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_TextPrsBuilder_HeaderFile
0017 #define _MeshVS_TextPrsBuilder_HeaderFile
0018 
0019 #include <Standard_Integer.hxx>
0020 #include <TCollection_AsciiString.hxx>
0021 #include <NCollection_DataMap.hxx>
0022 #include <MeshVS_PrsBuilder.hxx>
0023 #include <MeshVS_DisplayModeFlags.hxx>
0024 #include <MeshVS_BuilderPriority.hxx>
0025 
0026 class MeshVS_Mesh;
0027 class Quantity_Color;
0028 class MeshVS_DataSource;
0029 class TCollection_AsciiString;
0030 
0031 //! This class provides methods to create text data presentation.
0032 //! It store map of texts assigned with nodes or elements.
0033 class MeshVS_TextPrsBuilder : public MeshVS_PrsBuilder
0034 {
0035 
0036 public:
0037   Standard_EXPORT MeshVS_TextPrsBuilder(
0038     const occ::handle<MeshVS_Mesh>&       Parent,
0039     const double                          Height,
0040     const Quantity_Color&                 Color,
0041     const MeshVS_DisplayModeFlags&        Flags    = MeshVS_DMF_TextDataPrs,
0042     const occ::handle<MeshVS_DataSource>& DS       = nullptr,
0043     const int                             Id       = -1,
0044     const MeshVS_BuilderPriority&         Priority = MeshVS_BP_Text);
0045 
0046   //! Builds presentation of text data
0047   Standard_EXPORT void Build(const occ::handle<Prs3d_Presentation>& Prs,
0048                              const TColStd_PackedMapOfInteger&      IDs,
0049                              TColStd_PackedMapOfInteger&            IDsToExclude,
0050                              const bool                             IsElement,
0051                              const int                              theDisplayMode) const override;
0052 
0053   //! Returns map of text assigned with nodes ( IsElement = False ) or elements ( IsElement = True )
0054   Standard_EXPORT const NCollection_DataMap<int, TCollection_AsciiString>& GetTexts(
0055     const bool IsElement) const;
0056 
0057   //! Sets map of text assigned with nodes or elements
0058   Standard_EXPORT void SetTexts(const bool                                               IsElement,
0059                                 const NCollection_DataMap<int, TCollection_AsciiString>& Map);
0060 
0061   //! Returns True if map isn't empty
0062   Standard_EXPORT bool HasTexts(const bool IsElement) const;
0063 
0064   //! Returns text assigned with single node or element
0065   Standard_EXPORT bool GetText(const bool               IsElement,
0066                                const int                ID,
0067                                TCollection_AsciiString& Text) const;
0068 
0069   //! Sets text assigned with single node or element
0070   Standard_EXPORT void SetText(const bool                     IsElement,
0071                                const int                      ID,
0072                                const TCollection_AsciiString& Text);
0073 
0074   DEFINE_STANDARD_RTTIEXT(MeshVS_TextPrsBuilder, MeshVS_PrsBuilder)
0075 
0076 private:
0077   NCollection_DataMap<int, TCollection_AsciiString> myNodeTextMap;
0078   NCollection_DataMap<int, TCollection_AsciiString> myElemTextMap;
0079 };
0080 
0081 #endif // _MeshVS_TextPrsBuilder_HeaderFile