Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-17 09:21:48

0001 // Created on: 1996-12-05
0002 // Created by: Odile Olivier
0003 // Copyright (c) 1996-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 _PrsDim_DimensionOwner_HeaderFile
0018 #define _PrsDim_DimensionOwner_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <PrsDim_DimensionSelectionMode.hxx>
0023 #include <SelectMgr_EntityOwner.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <PrsMgr_PresentationManager.hxx>
0026 
0027 class SelectMgr_SelectableObject;
0028 class PrsMgr_PresentationManager;
0029 
0030 //! The owner is the entity which makes it possible to link
0031 //! the sensitive primitives and the reference shapes that
0032 //! you want to detect. It stocks the various pieces of
0033 //! information which make it possible to find objects. An
0034 //! owner has a priority which you can modulate, so as to
0035 //! make one entity more selectable than another. You
0036 //! might want to make edges more selectable than
0037 //! faces, for example. In that case, you could attribute sa
0038 //! higher priority to the one compared to the other. An
0039 //! edge, could have priority 5, for example, and a face,
0040 //! priority 4. The default priority is 5.
0041 class PrsDim_DimensionOwner : public SelectMgr_EntityOwner
0042 {
0043   DEFINE_STANDARD_RTTIEXT(PrsDim_DimensionOwner, SelectMgr_EntityOwner)
0044 public:
0045   //! Initializes the dimension owner, theSO, and attributes it
0046   //! the priority, thePriority.
0047   Standard_EXPORT PrsDim_DimensionOwner(const occ::handle<SelectMgr_SelectableObject>& theSelObject,
0048                                         const PrsDim_DimensionSelectionMode            theSelMode,
0049                                         const int thePriority = 0);
0050 
0051   PrsDim_DimensionSelectionMode SelectionMode() const { return mySelectionMode; }
0052 
0053   Standard_EXPORT void HilightWithColor(const occ::handle<PrsMgr_PresentationManager>& thePM,
0054                                         const occ::handle<Prs3d_Drawer>&               theStyle,
0055                                         const int theMode) override;
0056 
0057   //! Returns true if an object with the selection mode
0058   //! aMode is highlighted in the presentation manager aPM.
0059   Standard_EXPORT bool IsHilighted(const occ::handle<PrsMgr_PresentationManager>& thePM,
0060                                    const int theMode = 0) const override;
0061 
0062   //! Removes highlighting from the selected part of dimension.
0063   Standard_EXPORT void Unhilight(const occ::handle<PrsMgr_PresentationManager>& thePM,
0064                                  const int theMode = 0) override;
0065 
0066 private:
0067   PrsDim_DimensionSelectionMode mySelectionMode;
0068 };
0069 
0070 #endif // _AIS_DimensionOwner_HeaderFile