1 // Copyright (C) 2014-2019 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 email : webmaster.salome@opencascade.com
20 #ifndef PartSet_ResultSketchPrs_H
21 #define PartSet_ResultSketchPrs_H
23 #include "ModuleBase.h"
25 #include <ModelAPI_Result.h>
27 #include <ViewerData_AISShape.hxx>
29 #include <TopoDS_Compound.hxx>
31 DEFINE_STANDARD_HANDLE(PartSet_ResultSketchPrs, ViewerData_AISShape)
35 * A redefinition of standard AIS Interactive Object in order to provide specific behaviour
36 * for wire presentations based in a one plane
38 class PartSet_ResultSketchPrs: public ViewerData_AISShape
42 /// \param theResult a result object
43 Standard_EXPORT PartSet_ResultSketchPrs(ResultPtr theResult);
45 DEFINE_STANDARD_RTTIEXT(PartSet_ResultSketchPrs, ViewerData_AISShape)
47 /// Redefinition of virtual function
48 Standard_EXPORT virtual void Compute(
49 const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
50 const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
52 /// Redefinition of virtual function
53 Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
54 const Standard_Integer theMode) ;
57 /// Appens sensitive and owners for wires of the given shape into selection
58 /// \param theSelection a current filled selection
59 /// \param theShape a shape
60 /// \param theTypeOfSelection type of selection: VERTEX, EDGE, WIRE
61 void appendShapeSelection(const Handle(SelectMgr_Selection)& theSelection,
62 const TopoDS_Shape& theShape,
63 const TopAbs_ShapeEnum& theTypeOfSelection);
65 /// Sets color/line style/width of the presentation depending on the parameter state
66 /// \param isAuxiliary a boolean value if the properties are for auxiliary objects
67 void setAuxiliaryPresentationStyle(const bool isAuxiliary);
69 /// Fills the containers by the current result
70 /// \param theResultShape contains a shape of the result, it will be set as a Shape of AIS_Shape
71 /// \param theAuxiliaryCompound a compound of auxiliary shapes
72 /// \param theFaceList a list of face shapes
73 void fillShapes(TopoDS_Shape& aResultShape,
74 TopoDS_Compound& theAuxiliaryCompound,
75 NCollection_List<TopoDS_Shape>& theFaceList);
77 /// Reference to result object
80 /// Original shape of the result object
81 TopoDS_Shape myOriginalShape;
83 /// Compound of auxiliary shapes
84 TopoDS_Compound myAuxiliaryCompound;
87 //std::list<std::shared_ptr<GeomAPI_Shape> > myFacesList;
88 NCollection_List<TopoDS_Shape> mySketchFaceList;