Salome HOME
Merge branch 'SALOME-8.2.0_porting'
[modules/shaper.git] / src / PartSet / PartSet_ResultSketchPrs.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSet_ResultSketchPrs.h
4 // Created:     25 March 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef PartSet_ResultSketchPrs_H
8 #define PartSet_ResultSketchPrs_H
9
10 #include "ModuleBase.h"
11
12 #include <ModelAPI_Result.h>
13
14 #include <ViewerData_AISShape.hxx>
15
16 #include <TopoDS_Compound.hxx>
17
18 DEFINE_STANDARD_HANDLE(PartSet_ResultSketchPrs, ViewerData_AISShape)
19
20 /**
21 * \ingroup GUI
22 * A redefinition of standard AIS Interactive Object in order to provide specific behaviour 
23 * for wire presentations based in a one plane
24 */
25 class PartSet_ResultSketchPrs: public ViewerData_AISShape
26 {
27 public:
28   /// Constructor
29   /// \param theResult a result object
30   Standard_EXPORT PartSet_ResultSketchPrs(ResultPtr theResult);
31
32   DEFINE_STANDARD_RTTIEXT(PartSet_ResultSketchPrs, ViewerData_AISShape)
33 protected:
34   /// Redefinition of virtual function
35   Standard_EXPORT virtual void Compute(
36     const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
37     const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
38
39   /// Redefinition of virtual function
40   Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
41     const Standard_Integer theMode) ;
42
43 private:
44   /// Appens sensitive and owners for wires of the given shape into selection
45   /// \param theSelection a current filled selection
46   /// \param theShape a shape
47   /// \param theTypeOfSelection type of selection: VERTEX, EDGE, WIRE
48   void appendShapeSelection(const Handle(SelectMgr_Selection)& theSelection,
49                             const TopoDS_Shape& theShape,
50                             const TopAbs_ShapeEnum& theTypeOfSelection);
51
52   /// Sets color/line style/width of the presentation depending on the parameter state
53   /// \param isAuxiliary a boolean value if the properties are for auxiliary objects
54   void setAuxiliaryPresentationStyle(const bool isAuxiliary);
55
56   /// Fills the containers by the current result
57   /// \param theResultShape contains a shape of the result, it will be set as a Shape of AIS_Shape
58   /// \param theAuxiliaryCompound a compound of auxiliary shapes
59   /// \param theFaceList a list of face shapes
60   void fillShapes(TopoDS_Shape& aResultShape,
61                   TopoDS_Compound& theAuxiliaryCompound,
62                   NCollection_List<TopoDS_Shape>& theFaceList);
63
64   /// Reference to result object
65   ResultPtr myResult;
66
67   /// Original shape of the result object
68   TopoDS_Shape myOriginalShape;
69
70   /// Compound of auxiliary shapes
71   TopoDS_Compound myAuxiliaryCompound;
72
73   /// List of faces
74   //std::list<std::shared_ptr<GeomAPI_Shape> > myFacesList;
75   NCollection_List<TopoDS_Shape> mySketchFaceList;
76 };
77
78
79 #endif