Version: 9.12.0
libSMESH_Swig.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
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 LIBSMESH_SWIG_H
21 #define LIBSMESH_SWIG_H
22 
23 #ifdef WIN32
24 #if defined SMESH_SWIG_EXPORTS || defined _libSMESH_Swig_EXPORTS
25  #define SMESH_SWIG_EXPORT __declspec(dllexport)
26  #else
27  #define SMESH_SWIG_EXPORT __declspec(dllimport)
28  #endif
29 #else
30  #define SMESH_SWIG_EXPORT
31 #endif
32 
33 #include <SVTK_Selection.h>
34 #include <vector>
35 
36 // See SMESH_Actor.h
37 typedef enum
38 {
39  EntityNone = 0x00,
40  Entity0d = 0x01, // SMESH_Actor::e0DElements
41  EntityEdges = 0x02, // SMESH_Actor::eEdges
42  EntityFaces = 0x04, // SMESH_Actor::eFaces
43  EntityVolumes = 0x08, // SMESH_Actor::eVolumes
44  EntityBalls = 0x10, // SMESH_Actor::eBallElem
45  EntityAll = 0xff // SMESH_Actor::eAllEntity
47 
48 // See SVTK_Selection.h
49 typedef enum
50 {
51  Undefined = -1,
52  Node = NodeSelection,
53  Cell = CellSelection,
54  EdgeOfCell = EdgeOfCellSelection,
55  Edge = EdgeSelection,
56  Face = FaceSelection,
57  Volume = VolumeSelection,
58  Actor = ActorSelection,
59  Elem0D = Elem0DSelection,
60  Ball = BallSelection
62 
63 // See SMESH_Actor.h
64 typedef enum
65 {
67  PointMode = 0, // SMESH_Actor::ePoint
68  EdgeMode, // SMESH_Actor::eEdge
69  SurfaceMode // SMESH_Actor::eSurface
71 
72 struct ColorData
73 {
74  double r, g, b;
75 public:
76  ColorData();
77 };
78 
80 {
81  double r, g, b;
82  int delta;
83 public:
84  BicolorData();
85 };
86 
87 struct Properties
88 {
92 
94  int edgeWidth;
95 
98 
101 
103  double ballScale;
104 
107 
111 
112  double shrinkFactor;
113  double opacity;
114 
115 public:
116  Properties();
117 };
118 
119 typedef ColorData nodeColorStruct; // deprecated
120 typedef ColorData edgeColorStruct; // deprecated
121 typedef BicolorData surfaceColorStruct; // deprecated
122 typedef BicolorData volumeColorStruct; // deprecated
123 typedef Properties actorAspect; // deprecated
124 
126 {
127 public:
128  SMESH_Swig();
129  ~SMESH_Swig();
130 
131 
132  // Initialization =============================================
133 
134  void Init(); // deprecated
135 
136  // Publishing =================================================
137 
138  const char* publish(const char*, const char* = 0);
139  void rename(const char*, const char*);
140 
141  const char* AddNewMesh(const char*, const char* = 0); // deprecated
142  const char* AddNewHypothesis(const char*, const char* = 0); // deprecated
143  const char* AddNewAlgorithm(const char*, const char* = 0); // deprecated
144  const char* AddNewAlgorithms(const char*, const char* = 0); // deprecated
145 
146  void SetShape(const char*, const char*); // deprecated
147 
148  void SetHypothesis(const char*, const char*); // deprecated
149  void SetAlgorithms(const char*, const char*); // deprecated
150 
151  void UnSetHypothesis(const char*); // deprecated
152 
153  const char* AddSubMesh(const char*, const char*, int, const char* = 0); // deprecated
154  const char* AddSubMeshOnShape(const char*, const char*, const char*, int, const char* = 0); // deprecated
155 
156  void SetName(const char*, const char*); // deprecated
157 
158  void SetMeshIcon(const char*, const bool, const bool); // deprecated
159 
160  // Visualization =============================================
161 
162  void display(const char*, int = 0, bool = true);
163  void erase(const char*, int = 0, bool = true);
164  void update(const char*);
165 
166  Properties properties(const char*, int = 0);
167  void setProperties(const char*, const Properties&, int = 0);
168 
169  bool nodesNumbering(const char*, int = 0);
170  void setNodesNumbering(const char*, bool, int = 0);
171  bool elementsNumbering(const char*, int = 0);
172  void setElementsNumbering(const char*, bool, int = 0);
173 
174  DisplayMode displayMode(const char*, int = 0);
175  void setDisplayMode(const char*, DisplayMode, int = 0);
176 
177  bool shrinkMode(const char*, int = 0);
178  void setShrinkMode(const char*, bool, int = 0);
179 
180  double opacity(const char*, int = 0);
181  void setOpacity(const char*, double, int = 0);
182 
183  bool isOrientationShown(const char*, int = 0);
184  void setOrientationShown(const char*, bool, int = 0);
185 
186  int entitiesShown(const char*, int = 0);
187  void setEntitiesShown(const char*, int, int = 0);
188  bool isEntityShown(const char*, EntityMode, int = 0);
189  void setEntityShown(const char*, EntityMode, bool, int = 0);
190 
191  void CreateAndDisplayActor(const char*); // deprecated
192  void EraseActor(const char*, const bool = false); // deprecated
193  void UpdateActor(const char* Mesh_Entry); // deprecated
194 
195  actorAspect GetActorAspect(const char*, int = 0); // deprecated
196  void SetActorAspect(const actorAspect&, const char*, int = 0); // deprecated
197 
198  // Selection =================================================
199 
200  SelectionMode getSelectionMode(int = 0);
201  void setSelectionMode(SelectionMode, int = 0);
202  std::vector<int> getSelected(const char*);
203  std::vector<std::pair<int, int> > getSelectedEdgeOfCell(const char*);
204 
205  void select(const char*, std::vector<int>, bool = false);
206  void select(const char*, int, bool = false);
207  void select(const char*, std::vector<std::pair<int,int> >, bool = false);
208 
209 private:
210  void init();
211 
212 };
213 
214 #endif // LIBSMESH_SWIG_H
SMESH GUI Python interface.
Definition: libSMESH_Swig.h:126
EntityMode
Definition: libSMESH_Swig.h:38
@ Entity0d
0D elements.
Definition: libSMESH_Swig.h:40
@ EntityBalls
Ball elements.
Definition: libSMESH_Swig.h:44
@ EntityNone
Definition: libSMESH_Swig.h:39
@ EntityAll
All elements.
Definition: libSMESH_Swig.h:45
@ EntityVolumes
Volumes.
Definition: libSMESH_Swig.h:43
@ EntityEdges
Edges.
Definition: libSMESH_Swig.h:41
@ EntityFaces
Faces.
Definition: libSMESH_Swig.h:42
#define SMESH_SWIG_EXPORT
Definition: libSMESH_Swig.h:30
ColorData edgeColorStruct
Definition: libSMESH_Swig.h:120
DisplayMode
Definition: libSMESH_Swig.h:65
@ EdgeMode
Wireframe representation.
Definition: libSMESH_Swig.h:68
@ SurfaceMode
Surface representation.
Definition: libSMESH_Swig.h:69
@ UndefinedMode
Undefined display mode.
Definition: libSMESH_Swig.h:66
@ PointMode
Point representation.
Definition: libSMESH_Swig.h:67
Properties actorAspect
Definition: libSMESH_Swig.h:123
SelectionMode
Definition: libSMESH_Swig.h:50
@ Actor
Selection of whole actors (meshes, sub-meshes, groups).
Definition: libSMESH_Swig.h:58
@ Ball
Selection of ball ellements.
Definition: libSMESH_Swig.h:60
@ Cell
Selection of any mesh cells.
Definition: libSMESH_Swig.h:53
@ Volume
Selection of volumes.
Definition: libSMESH_Swig.h:57
@ Elem0D
Selection of 0D elements.
Definition: libSMESH_Swig.h:59
@ EdgeOfCell
Selection of pseudo-edges specified by couple of nodes.
Definition: libSMESH_Swig.h:54
@ Face
Selection of faces.
Definition: libSMESH_Swig.h:56
@ Edge
Selection of edges.
Definition: libSMESH_Swig.h:55
@ Undefined
Undefined selection mode.
Definition: libSMESH_Swig.h:51
@ Node
Selection of mesh nodes.
Definition: libSMESH_Swig.h:52
ColorData nodeColorStruct
Definition: libSMESH_Swig.h:119
BicolorData volumeColorStruct
Definition: libSMESH_Swig.h:122
BicolorData surfaceColorStruct
Definition: libSMESH_Swig.h:121
void SetName(_PTR(SObject) theSObject, const QString &theName)
Definition: SMESHGUI_Utils.cxx:134
Bi-color data, in RGBf format.
Definition: libSMESH_Swig.h:80
double r
Red color's component (0.0:1.0).
Definition: libSMESH_Swig.h:81
BicolorData()
Constructor.
Definition: libSMESH_Swig.cxx:458
double b
Blue color's component (0.0:1.0).
Definition: libSMESH_Swig.h:81
int delta
Shift for backface color (-100:100).
Definition: libSMESH_Swig.h:82
double g
Green color's component (0.0:1.0).
Definition: libSMESH_Swig.h:81
Color data, in RGBf format.
Definition: libSMESH_Swig.h:73
double b
Blue color's component (0.0:1.0).
Definition: libSMESH_Swig.h:74
double r
Red color's component (0.0:1.0).
Definition: libSMESH_Swig.h:74
ColorData()
Constructor.
Definition: libSMESH_Swig.cxx:438
double g
Green color's component (0.0:1.0).
Definition: libSMESH_Swig.h:74
Mesh object presentation's properties.
Definition: libSMESH_Swig.h:88
ColorData elem0dColor
0D elements color.
Definition: libSMESH_Swig.h:99
ColorData outlineColor
Outlines color.
Definition: libSMESH_Swig.h:105
ColorData orientationColor
Face orientation vectors color.
Definition: libSMESH_Swig.h:108
BicolorData volumeColor
Volumes color.
Definition: libSMESH_Swig.h:97
int elem0dSize
0D elements size.
Definition: libSMESH_Swig.h:100
double ballScale
Ball elements scale factor.
Definition: libSMESH_Swig.h:103
int edgeWidth
Edges width.
Definition: libSMESH_Swig.h:94
double shrinkFactor
Shrink coefficient.
Definition: libSMESH_Swig.h:112
int markerType
Node standard marker type.
Definition: libSMESH_Swig.h:90
Properties()
Constructor.
Definition: libSMESH_Swig.cxx:506
BicolorData surfaceColor
Faces color.
Definition: libSMESH_Swig.h:96
double orientationScale
Face orientation vectors scale factor.
Definition: libSMESH_Swig.h:109
int outlineWidth
Outlines width.
Definition: libSMESH_Swig.h:106
ColorData nodeColor
Node color.
Definition: libSMESH_Swig.h:89
ColorData ballColor
Ball elements color.
Definition: libSMESH_Swig.h:102
ColorData edgeColor
Edges color.
Definition: libSMESH_Swig.h:93
int markerScale
Node scale factor.
Definition: libSMESH_Swig.h:91
bool orientation3d
Face orientation vectors 3d flag.
Definition: libSMESH_Swig.h:110
double opacity
Opacity.
Definition: libSMESH_Swig.h:113