1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PartSet_ResultSketchPrs.h
4 // Created: 25 March 2015
5 // Author: Natalia ERMOLAEVA
7 #ifndef PartSet_ResultSketchPrs_H
8 #define PartSet_ResultSketchPrs_H
10 #include "ModuleBase.h"
12 #include <ModelAPI_Result.h>
14 #include <ViewerData_AISShape.hxx>
16 #include <TopoDS_Compound.hxx>
18 DEFINE_STANDARD_HANDLE(PartSet_ResultSketchPrs, ViewerData_AISShape)
22 * A redefinition of standard AIS Interactive Object in order to provide specific behaviour
23 * for wire presentations based in a one plane
25 class PartSet_ResultSketchPrs: public ViewerData_AISShape
29 /// \param theResult a result object
30 Standard_EXPORT PartSet_ResultSketchPrs(ResultPtr theResult);
32 /// Returns true if the checked type can be accepted for the base selection type
33 /// It returns true if they are coicide or if the base type is face and the checked type is wire
34 /// @return boolean result
35 static Standard_EXPORT bool isValidShapeType(const TopAbs_ShapeEnum& theBaseType,
36 const TopAbs_ShapeEnum& theCheckedType);
38 DEFINE_STANDARD_RTTI(PartSet_ResultSketchPrs)
40 /// Redefinition of virtual function
41 Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
42 const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
44 /// Redefinition of virtual function
45 Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
46 const Standard_Integer aMode) ;
49 /// Appens sensitive and owners for wires of the given shape into selection
50 /// \param theSelection a current filled selection
51 /// \param theShape a shape
52 /// \param theTypeOfSelection type of selection: VERTEX, EDGE, WIRE
53 void appendShapeSelection(const Handle(SelectMgr_Selection)& theSelection,
54 const TopoDS_Shape& theShape, const TopAbs_ShapeEnum& theTypeOfSelection);
56 /// Sets color/line style/width of the presentation depending on the parameter state
57 /// \param isAuxiliary a boolean value if the properties are for auxiliary objects
58 void setAuxiliaryPresentationStyle(const bool isAuxiliary);
60 /// Reference to result object
63 /// Original shape of the result object
64 TopoDS_Shape myOriginalShape;
66 /// Compound of auxiliary shapes
67 TopoDS_Compound myAuxiliaryCompound;
70 std::list<std::shared_ptr<GeomAPI_Shape> > myFacesList;