Back to home page

EIC code displayed by LXR

 
 

    


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

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