Salome HOME
ce403d192c17513568ae34c585ccf0d6f9516649
[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   /// 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);
37
38   DEFINE_STANDARD_RTTI(PartSet_ResultSketchPrs)
39 protected:
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);
43
44   /// Redefinition of virtual function
45   Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
46     const Standard_Integer aMode) ;
47
48 private:
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);
55
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);
59
60   /// Fills the containers by the current result
61   /// \param theResultShape contains a shape of the result, it will be set as a Shape of AIS_Shape
62   /// \param theAuxiliaryCompound a compound of auxiliary shapes
63   /// \param theFaceList a list of face shapes
64   void PartSet_ResultSketchPrs::fillShapes(TopoDS_Shape& aResultShape,
65                                          TopoDS_Compound& theAuxiliaryCompound,
66                                          NCollection_List<TopoDS_Shape>& theFaceList);
67
68   /// Reference to result object
69   ResultPtr myResult;
70
71   /// Original shape of the result object
72   TopoDS_Shape myOriginalShape;
73
74   /// Compound of auxiliary shapes
75   TopoDS_Compound myAuxiliaryCompound;
76
77   /// List of faces
78   //std::list<std::shared_ptr<GeomAPI_Shape> > myFacesList;
79   NCollection_List<TopoDS_Shape> mySketchFaceList;
80 };
81
82
83 #endif