1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef PartSet_ResultSketchPrs_H
22 #define PartSet_ResultSketchPrs_H
24 #include "ModuleBase.h"
26 #include <ModelAPI_Result.h>
28 #include <ViewerData_AISShape.hxx>
30 #include <TopoDS_Compound.hxx>
32 DEFINE_STANDARD_HANDLE(PartSet_ResultSketchPrs, ViewerData_AISShape)
36 * A redefinition of standard AIS Interactive Object in order to provide specific behaviour
37 * for wire presentations based in a one plane
39 class PartSet_ResultSketchPrs: public ViewerData_AISShape
43 /// \param theResult a result object
44 Standard_EXPORT PartSet_ResultSketchPrs(ResultPtr theResult);
46 DEFINE_STANDARD_RTTIEXT(PartSet_ResultSketchPrs, ViewerData_AISShape)
48 /// Redefinition of virtual function
49 Standard_EXPORT virtual void Compute(
50 const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
51 const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
53 /// Redefinition of virtual function
54 Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
55 const Standard_Integer theMode) ;
58 /// Appens sensitive and owners for wires of the given shape into selection
59 /// \param theSelection a current filled selection
60 /// \param theShape a shape
61 /// \param theTypeOfSelection type of selection: VERTEX, EDGE, WIRE
62 void appendShapeSelection(const Handle(SelectMgr_Selection)& theSelection,
63 const TopoDS_Shape& theShape,
64 const TopAbs_ShapeEnum& theTypeOfSelection);
66 /// Sets color/line style/width of the presentation depending on the parameter state
67 /// \param isAuxiliary a boolean value if the properties are for auxiliary objects
68 void setAuxiliaryPresentationStyle(const bool isAuxiliary);
70 /// Fills the containers by the current result
71 /// \param theResultShape contains a shape of the result, it will be set as a Shape of AIS_Shape
72 /// \param theAuxiliaryCompound a compound of auxiliary shapes
73 /// \param theFaceList a list of face shapes
74 void fillShapes(TopoDS_Shape& aResultShape,
75 TopoDS_Compound& theAuxiliaryCompound,
76 NCollection_List<TopoDS_Shape>& theFaceList);
78 /// Reference to result object
81 /// Original shape of the result object
82 TopoDS_Shape myOriginalShape;
84 /// Compound of auxiliary shapes
85 TopoDS_Compound myAuxiliaryCompound;
88 //std::list<std::shared_ptr<GeomAPI_Shape> > myFacesList;
89 NCollection_List<TopoDS_Shape> mySketchFaceList;