Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-12-03 10:55:24

0001 // Created on: 1993-01-09
0002 // Created by: CKY / Contract Toubro-Larsen ( TCD )
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _IGESDraw_LabelDisplay_HeaderFile
0018 #define _IGESDraw_LabelDisplay_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <IGESData_ViewKindEntity.hxx>
0024 #include <NCollection_Array1.hxx>
0025 #include <NCollection_HArray1.hxx>
0026 #include <gp_XYZ.hxx>
0027 #include <IGESDimen_LeaderArrow.hxx>
0028 #include <Standard_Integer.hxx>
0029 #include <IGESData_IGESEntity.hxx>
0030 #include <IGESData_LabelDisplayEntity.hxx>
0031 class IGESData_ViewKindEntity;
0032 class gp_Pnt;
0033 class IGESDimen_LeaderArrow;
0034 class IGESData_IGESEntity;
0035 
0036 //! defines IGESLabelDisplay, Type <402> Form <5>
0037 //! in package IGESDraw
0038 //!
0039 //! Permits one or more displays for the
0040 //! entity labels of an entity
0041 class IGESDraw_LabelDisplay : public IGESData_LabelDisplayEntity
0042 {
0043 
0044 public:
0045   Standard_EXPORT IGESDraw_LabelDisplay();
0046 
0047   //! This method is used to set the fields of the class
0048   //! LabelDisplay
0049   //! - allViews             : Pointers to View Entities
0050   //! - allTextLocations     : Coordinates of text locations in the views
0051   //! - allLeaderEntities    : Pointers to Leader Entities in the views
0052   //! - allLabelLevels       : Entity label level numbers in the views
0053   //! - allDisplayedEntities : Pointers to the entities being displayed
0054   //! raises exception if Lengths of allViews, allTextLocations,
0055   //! allLeaderEntities, allLabelLevels and allDisplayedEntities are
0056   //! not same.
0057   Standard_EXPORT void Init(
0058     const occ::handle<NCollection_HArray1<occ::handle<IGESData_ViewKindEntity>>>& allViews,
0059     const occ::handle<NCollection_HArray1<gp_XYZ>>&                               allTextLocations,
0060     const occ::handle<NCollection_HArray1<occ::handle<IGESDimen_LeaderArrow>>>&   allLeaderEntities,
0061     const occ::handle<NCollection_HArray1<int>>&                                  allLabelLevels,
0062     const occ::handle<NCollection_HArray1<occ::handle<IGESData_IGESEntity>>>& allDisplayedEntities);
0063 
0064   //! returns the number of label placements in <me>
0065   Standard_EXPORT int NbLabels() const;
0066 
0067   //! returns the View entity indicated by ViewIndex
0068   //! raises an exception if ViewIndex <= 0 or ViewIndex > NbLabels().
0069   Standard_EXPORT occ::handle<IGESData_ViewKindEntity> ViewItem(const int ViewIndex) const;
0070 
0071   //! returns the 3d-Point coordinates of the text location, in the
0072   //! view indicated by ViewIndex
0073   //! raises an exception if ViewIndex <= 0 or ViewIndex > NbLabels().
0074   Standard_EXPORT gp_Pnt TextLocation(const int ViewIndex) const;
0075 
0076   //! returns the Leader entity in the view indicated by ViewIndex
0077   //! raises an exception if ViewIndex <= 0 or ViewIndex > NbLabels().
0078   Standard_EXPORT occ::handle<IGESDimen_LeaderArrow> LeaderEntity(const int ViewIndex) const;
0079 
0080   //! returns the Entity label level number in the view indicated
0081   //! by ViewIndex
0082   //! raises an exception if ViewIndex <= 0 or ViewIndex > NbLabels().
0083   Standard_EXPORT int LabelLevel(const int ViewIndex) const;
0084 
0085   //! returns the entity indicated by EntityIndex
0086   //! raises an exception if EntityIndex <= 0 or EntityIndex > NbLabels().
0087   Standard_EXPORT occ::handle<IGESData_IGESEntity> DisplayedEntity(const int EntityIndex) const;
0088 
0089   //! returns the transformed 3d-Point coordinates of the text
0090   //! location, in the view indicated by ViewIndex
0091   //! raises an exception if ViewIndex <= 0 or ViewIndex > NbLabels().
0092   Standard_EXPORT gp_Pnt TransformedTextLocation(const int ViewIndex) const;
0093 
0094   DEFINE_STANDARD_RTTIEXT(IGESDraw_LabelDisplay, IGESData_LabelDisplayEntity)
0095 
0096 private:
0097   occ::handle<NCollection_HArray1<occ::handle<IGESData_ViewKindEntity>>> theViews;
0098   occ::handle<NCollection_HArray1<gp_XYZ>>                               theTextLocations;
0099   occ::handle<NCollection_HArray1<occ::handle<IGESDimen_LeaderArrow>>>   theLeaderEntities;
0100   occ::handle<NCollection_HArray1<int>>                                  theLabelLevels;
0101   occ::handle<NCollection_HArray1<occ::handle<IGESData_IGESEntity>>>     theDisplayedEntities;
0102 };
0103 
0104 #endif // _IGESDraw_LabelDisplay_HeaderFile