Salome HOME
ddf21d1ecd72d143e2a0bd0be691425b1daf6325
[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_RTTI(PartSet_ResultSketchPrs)
33 protected:
34   /// Redefinition of virtual function
35   Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
36     const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
37
38   /// Redefinition of virtual function
39   Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
40     const Standard_Integer aMode) ;
41
42 private:
43   /// Appens sensitive and owners for wires of the given shape into selection
44   /// \param theSelection a current filled selection
45   /// \param theShape a shape
46   /// \param theTypeOfSelection type of selection: VERTEX, EDGE, WIRE
47   void appendShapeSelection(const Handle(SelectMgr_Selection)& theSelection,
48                             const TopoDS_Shape& theShape, const TopAbs_ShapeEnum& theTypeOfSelection);
49
50   /// Sets color/line style/width of the presentation depending on the parameter state
51   /// \param isAuxiliary a boolean value if the properties are for auxiliary objects
52   void setAuxiliaryPresentationStyle(const bool isAuxiliary);
53
54   /// Fills the containers by the current result
55   /// \param theResultShape contains a shape of the result, it will be set as a Shape of AIS_Shape
56   /// \param theAuxiliaryCompound a compound of auxiliary shapes
57   /// \param theFaceList a list of face shapes
58   void fillShapes(TopoDS_Shape& aResultShape,
59                   TopoDS_Compound& theAuxiliaryCompound,
60                   NCollection_List<TopoDS_Shape>& theFaceList);
61
62   /// Reference to result object
63   ResultPtr myResult;
64
65   /// Original shape of the result object
66   TopoDS_Shape myOriginalShape;
67
68   /// Compound of auxiliary shapes
69   TopoDS_Compound myAuxiliaryCompound;
70
71   /// List of faces
72   //std::list<std::shared_ptr<GeomAPI_Shape> > myFacesList;
73   NCollection_List<TopoDS_Shape> mySketchFaceList;
74 };
75
76
77 #endif