Salome HOME
9aa671fc874b042b5c55d7d49ed3f9584e62c19c
[modules/shaper.git] / src / PartSet / PartSet_FieldStepPrs.h
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef PartSet_FieldStepPrs_H
21 #define PartSet_FieldStepPrs_H
22
23 #include "PartSet.h"
24 #include <ModuleBase_IStepPrs.h>
25
26 #include <ModelAPI_ResultField.h>
27 #include <ModelAPI_Feature.h>
28
29 #include <ViewerData_AISShape.hxx>
30
31 #include <QList>
32
33 DEFINE_STANDARD_HANDLE(PartSet_FieldStepPrs, ViewerData_AISShape)
34
35 /**
36 * \ingroup GUI
37 * A redefinition of standard AIS Interactive Object in order to provide specific behaviour
38 * for wire presentations based in a one plane
39 */
40 class PartSet_FieldStepPrs : public ViewerData_AISShape, public ModuleBase_IStepPrs
41 {
42 public:
43   /// Constructor
44   /// \param theResult a result object
45   Standard_EXPORT PartSet_FieldStepPrs(FieldStepPtr theStep);
46
47   ModelAPI_AttributeTables::ValueType dataType() const;
48
49   bool dataRange(double& theMin, double& theMax) const;
50
51   DEFINE_STANDARD_RTTIEXT(PartSet_FieldStepPrs, ViewerData_AISShape)
52
53 protected:
54   //! Compute presentation considering sub-shape color map.
55   virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
56     const Handle(Prs3d_Presentation)& thePrs,  const Standard_Integer theMode);
57
58 private:
59   QList<double> range(double& theMin, double& theMax) const;
60
61   FieldStepPtr myStep;
62   FeaturePtr myFeature;
63 };
64
65 #endif