SHAPER  9.12.0
PartSet_FieldStepPrs.h
1 // Copyright (C) 2014-2023 CEA, EDF
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 #include <TopoDS_Shape.hxx>
31 #include <gp_Pnt.hxx>
32 
33 #include <QList>
34 
35 DEFINE_STANDARD_HANDLE(PartSet_FieldStepPrs, ViewerData_AISShape)
36 
37 
43 {
44 public:
47  Standard_EXPORT PartSet_FieldStepPrs(FieldStepPtr theStep);
48 
49  ModelAPI_AttributeTables::ValueType dataType() const;
50 
51  bool dataRange(double& theMin, double& theMax) const;
52 
53  DEFINE_STANDARD_RTTIEXT(PartSet_FieldStepPrs, ViewerData_AISShape)
54 
55 protected:
57  virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
58  const Handle(Prs3d_Presentation)& thePrs, const Standard_Integer theMode);
59 
60 private:
61  QList<double> range(double& theMin, double& theMax) const;
62  QList<double> booleanValues() const;
63  QStringList strings() const;
64  bool computeMassCenter(const TopoDS_Shape& theShape, gp_Pnt& theCenter);
65 
66 
67  FieldStepPtr myStep;
68  FeaturePtr myFeature;
69 };
70 
71 #endif
ValueType
Type of the value in the table.
Definition: ModelAPI_AttributeTables.h:42
Definition: ModuleBase_IStepPrs.h:27
A redefinition of standard AIS Interactive Object in order to provide specific behaviour for wire pre...
Definition: PartSet_FieldStepPrs.h:43