1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_ResultPrs.h
4 // Created: 21 October 2014
5 // Author: Vitaly SMETANNIKOV
7 #ifndef ModuleBase_ResultPrs_H
8 #define ModuleBase_ResultPrs_H
10 #include "ModuleBase.h"
12 #include <ModelAPI_Result.h>
14 #include <ViewerData_AISShape.hxx>
15 #include <Standard_DefineHandle.hxx>
16 #include <StdSelect_BRepOwner.hxx>
18 DEFINE_STANDARD_HANDLE(ModuleBase_BRepOwner, StdSelect_BRepOwner)
22 * A redefinition of standard BRep Owner in order to provide specific selection
23 * of CompSolid objects. This owner is created only for selection mode TopAbs_COMPSOLID
25 class ModuleBase_BRepOwner: public StdSelect_BRepOwner
28 ModuleBase_BRepOwner(const TopoDS_Shape& aShape,
29 const Standard_Integer aPriority = 0,
30 const Standard_Boolean ComesFromDecomposition = Standard_False)
31 : StdSelect_BRepOwner(aShape, aPriority, ComesFromDecomposition) {}
33 virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& aPM,
34 const Quantity_NameOfColor aCol, const Standard_Integer aMode = 0)
35 { Selectable()->HilightOwnerWithColor(aPM, aCol, this); }
37 DEFINE_STANDARD_RTTI(ModuleBase_BRepOwner)
42 DEFINE_STANDARD_HANDLE(ModuleBase_ResultPrs, ViewerData_AISShape)
46 * A redefinition of standard AIS Interactive Object in order to provide specific behaviour
47 * for wire presentations based in a one plane
49 class ModuleBase_ResultPrs: public ViewerData_AISShape
53 /// \param theResult a result object
54 Standard_EXPORT ModuleBase_ResultPrs(ResultPtr theResult);
56 /// Returns true if the checked type can be accepted for the base selection type
57 /// It returns true if they are coicide or if the base type is face and the checked type is wire
58 /// @return boolean result
59 static Standard_EXPORT bool isValidShapeType(const TopAbs_ShapeEnum& theBaseType,
60 const TopAbs_ShapeEnum& theCheckedType);
63 //! Method which draws selected owners ( for fast presentation draw )
64 Standard_EXPORT virtual void HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM,
65 const SelectMgr_SequenceOfOwner& theOwners);
67 //! Method which hilight an owner belonging to
68 //! this selectable object ( for fast presentation draw )
69 Standard_EXPORT virtual void HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM,
70 const Quantity_NameOfColor theColor, const Handle(SelectMgr_EntityOwner)& theOwner);
72 /// Returns result object
73 Standard_EXPORT ResultPtr getResult() const { return myResult; }
75 DEFINE_STANDARD_RTTI(ModuleBase_ResultPrs)
77 /// Redefinition of virtual function
78 Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
79 const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
81 /// Redefinition of virtual function
82 Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
83 const Standard_Integer aMode) ;
86 /// Appens sensitive and owners for wires of the given shape into selection
87 /// \param theSelection a current filled selection
88 /// \param theShape a shape
89 void appendWiresSelection(const Handle(SelectMgr_Selection)& theSelection,
90 const TopoDS_Shape& theShape);
92 /// Reference to result object
95 /// Original shape of the result object
96 TopoDS_Shape myOriginalShape;