1 // Copyright (C) 2003 CEA/DEN, EDF R&D
6 // Author : Alexey Petrov
8 /*! \file VISU_Gen.idl This file conatins a set of interfaces of %VISU module.
9 This module will provide various forms of data visualization in %SALOME application.
10 These forms include data tables, XY plots, 3d representations
11 and combination of these forms.
14 \defgroup Visu SALOME VISU module
20 #include "SALOME_Exception.idl"
21 #include "SALOME_Component.idl"
22 #include "SALOMEDS.idl"
23 #include "SALOMEDS_Attributes.idl"
27 The main package of interfaces of the module %VISU.
30 //-------------------------------------------------------
31 typedef string IdType;
32 enum Scaling{ LINEAR, LOGARITHMIC};
33 enum Entity{ NODE, EDGE, FACE, CELL};
34 //enum Entity{ CELL, FACE, EDGE, NODE};
36 This enumeration contains a set of elements defining the type of the module.
39 TCURVE, TTABLE, TCONTAINER, TMESH, TSCALARMAP,
40 TISOSURFACE, TDEFORMEDSHAPE, TCUTPLANES, TCUTLINES, TVECTORS, TSTREAMLINES,
41 TVISUGEN, TVIEWMANAGER, TRESULT,
42 TXYPLOT, TTABLEVIEW, TVIEW3D,
43 TENTITY, TFAMILY, TGROUP, TFIELD, TTIMESTAMP,
47 Returns ID of the object.
51 Returns the type of the presentable object
55 /*! \brief Presentable object interface
57 It is the root class of all presentable objects.
59 interface PrsObject : Base{
61 //-------------------------------------------------------
62 /*! \brief %Table representation interface
64 Presentation parameters of the %Table view.
66 interface Table : PrsObject {
68 Sets the title of the table.
70 void SetTitle(in string theTitle);
72 Gets the title of the table.
76 This enumeration contains a set of elements defining the orientation of the table.
78 enum Orientation{ HORIZONTAL, /*!<Horizontal orientation of the table.*/
79 VERTIACAL /*!<Vertical orientation of the table.*/
82 Sets orientation of the table.
84 void SetOrientation(in Orientation theOrientation);
86 Gets orientation of the table.
88 Orientation GetOrientation();
90 Gets the number of rows of the table
94 Gets the number of columns of the table
98 //-------------------------------------------------------
99 /*! \brief Interface of curve representation.
101 Manages presentation parameters of one curve.
102 It can be used for presentation of a set of curves using a combined presentation.
104 interface Curve : PrsObject{
106 Sets the title of the curve.
108 void SetTitle(in string theTitle);
110 Gets the title of the curve.
114 Sets the color of the curve.
116 void SetColor(in SALOMEDS::Color theColor);
118 Gets the color of the curve.
120 SALOMEDS::Color GetColor();
122 This enumeration contains a set of elements defining the representation type of markers (data points) with help of
123 which the curve is constructed on the graphics.
125 enum MarkerType{ NONE, CIRCLE, RECTANGLE, DIAMOND,
126 DTRIANGLE, UTRIANGLE, LTRIANGLE, RTRIANGLE,
129 Sets the representation type of markers (data points) with help of
130 which the curve is constructed on the graphics.
132 void SetMarker(in MarkerType theType);
134 Gets the representation type of markers (data points) with help of
135 which the curve is constructed on the graphics.
137 MarkerType GetMarker();
139 This enumeration contains a set of elements defining the
140 type of representation of curve lines on the graphics.
142 enum LineType{ VOIDLINE, SOLIDLINE, DASHLINE, DOTLINE, DASHDOTLINE, DASHDOTDOTLINE};
144 Sets the type of representation of curve lines on the graphics.
146 void SetLine(in LineType theType, in long theLineWidth);
148 Gets the type of representation of curve lines on the graphics.
153 Gets the width of the curve line.
157 //-------------------------------------------------------
158 /*! \brief The %Container presentable object interface
159 This interface contains a set of methods used for management of a group of curves
160 which are stored in the container.
162 interface Container : PrsObject{
164 Adds a curve into the container.
166 void AddCurve(in Curve theCurve);
168 Removes a curve from the container.
170 void RemoveCurve(in Curve theCurve);
172 Gets the number of curves which are stored in the container.
176 Removes all curves from the container.
181 //-------------------------------------------------------
182 interface Prs3d : PrsObject{
186 This enumeration contains a set of elements defining the
187 type of representation of the mesh.
190 enum PresentationType{ POINT,
195 /*! \brief Interface of the mesh.
197 This interface manages the presentation parameters of the mesh.
199 interface Mesh : Prs3d{
201 Sets the color of mesh cells.
203 void SetCellColor(in SALOMEDS::Color theColor);
205 Gets the color of mesh cells.
207 SALOMEDS::Color GetCellColor();
209 Sets the color of mesh nodes.
211 void SetNodeColor(in SALOMEDS::Color theColor);
213 Gets the color of mesh nodes.
215 SALOMEDS::Color GetNodeColor();
218 Sets the color of mesh links.
220 void SetLinkColor(in SALOMEDS::Color theColor);
222 Gets the color of mesh links.
224 SALOMEDS::Color GetLinkColor();
226 Sets the type of representation of the mesh.
228 void SetPresentationType(in PresentationType theType);
230 Gets the type of representation of the mesh.
232 PresentationType GetPresentationType();
234 //-------------------------------------------------------
235 /*! \brief Interface of the %Scalar Map presentation
237 This interface contains presentation parameters of the ScalarMap presentation
239 interface ScalarMap : Prs3d{
240 void SetScalarMode(in long theScaling);
241 long GetScalarMode();
242 void SetScaling(in Scaling theScaling);
244 Gets the type of scaling of the values reflected by this presentation.
246 Scaling GetScaling();
248 Sets scalar range - min and max boundaries of this presentable object.
249 \param theMin Min boundary of this presentable object.
250 \param theMax Max boundary of this presentable object.
252 void SetRange(in double theMin, in double theMax);
254 Gets the min boundary of this presentable object.
258 Gets the max boundary of this presentable object.
262 /*! %Orientation of this presentable object. */
264 HORIZONTAL, /*!< Horizontal orientation of this presentable object.*/
265 VERTICAL /*!< Vertical orientation of this presentable object.*/
268 Sets the type of orientation of this presentable object.
270 void SetOrientation(in Orientation theOrientation);
272 Gets the type of orientation of this presentable object.
274 Orientation GetOrientation();
276 /*! \brief Position of this presentable object.
278 Sets the position of this presentable object origin on the screen.
279 \param X Horizontal position. The value can be between 0 and 1.
280 \param Y Vertical position. The value can be between 0 and 1.
282 void SetPosition(in double X, in double Y);
284 Gets horizontal position of this presentable object origin.
288 Gets vertical position of this presentable object origin.
291 /*! \brief Size of this presentable object.
293 Sets the size of the scalar bar.
294 \param theWidth Width of this presentable object. The value can be between 0 and 1.
295 \param theHeight Height of this presentable object. The value can be between 0 and 1.
297 void SetSize(in double theWidth, in double theHeight);
299 Gets the width of this presentable object.
303 Gets the height of this presentable object.
307 Sets the number of colors which will be used for presentation of this presentable object.
309 void SetNbColors(in long theNbColors);
311 Gets the number of colors which will be used for presentation of this presentable object.
315 Sets the number of labels which will be used for indication of the gradation
316 of this presentable object.
318 void SetLabels(in long theNbLabels);
320 Gets the number of labels which will be used for indication of the gradation
321 of this presentable object.
325 Sets the title of this presentable object. For scalar bar by default - the name of the selected result is used.
327 void SetTitle(in string theName);
329 Gets the title of this presentable object.
333 //-------------------------------------------------------
334 /*! \brief Deformed shape presentation interface
336 Presentation parameters of the deformed shape presentation.
338 interface DeformedShape : ScalarMap{
340 Sets the scale of the presentatable object.
342 void SetScale(in double theScale);
344 Gets the scale of the presentatable object.
348 //-------------------------------------------------------
349 /*! \brief Cut planes interface
351 Presentation parameters of Cut planes presentation.
353 interface CutPlanes : ScalarMap{
355 This enumeration contains a set of elements defining the orientation in 3D space
356 of cut planes presentation.
358 enum Orientation {XY, YZ, ZX};
360 Sets the type of orientation in 3D space of cut planes presentation.
362 void SetOrientationType(in Orientation theNb);
364 Gets the type of orientation in 3D space of cut planes presentation.
366 Orientation GetOrientationType();
367 void SetDisplacement(in double theDisp);
368 double GetDisplacement();
370 Sets the number of cut planes.
372 void SetNbPlanes(in long theNb);
374 Gets the number of cut planes.
377 /*! Rotation around X-axis.
378 Sets rotation angle of the cut plane presentation.
380 void SetRotateX(in double theAngle);
381 /*! Rotation around X-axis.
382 Gets rotation angle of the cut plane presentation.
385 /*! Rotation around Y-axis.
386 Sets rotation angle of the cut plane presentation.
388 void SetRotateY(in double theAngle);
389 /*! Rotation around Y-axis.
390 Sets rotation angle of the cut plane presentation.
394 //-------------------------------------------------------
395 /*! \brief Interface of the stream lines representation
396 This interface contains presentation parameters of
397 stream lines presentations.
399 /*! \brief Cut lines interface
401 Presentation parameters of Cut lines presentation.
403 interface CutLines : ScalarMap{
405 void SetOrientationType(in CutPlanes::Orientation theNb);
406 void SetOrientationType2(in CutPlanes::Orientation theNb);
408 CutPlanes::Orientation GetOrientationType();
409 CutPlanes::Orientation GetOrientationType2();
411 void SetDisplacement(in double theDisp);
412 void SetDisplacement2(in double theDisp);
414 double GetDisplacement();
415 double GetDisplacement2();
417 void SetNbLines(in long theNb);
420 void SetRotateX(in double theAngle);
421 void SetRotateX2(in double theAngle);
424 double GetRotateX2();
426 void SetRotateY(in double theAngle);
427 void SetRotateY2(in double theAngle);
430 double GetRotateY2();
433 interface StreamLines : DeformedShape{
434 enum Direction{ FORWARD,
439 void SetDirection(in Direction theDirection);
440 Direction GetDirection();
442 void SetStepLength(in double theStep);
443 double GetStepLength();
445 void SetPropagationTime(in double theTime);
446 double GetPropagationTime();
448 void SetIntegrationStep(in double theStep);
449 double GetIntegrationStep();
451 void SetSource(in Prs3d thePrs3d);
454 void SetUsedPoints(in double thePercents);
455 double GetUsedPoints();
459 /*! \brief Interface of the isometric surface representation
461 This interface contains presentation parameters of
462 isometric surface presentations.
464 interface IsoSurfaces : ScalarMap{
466 Sets the number of isometric surfaces.
468 void SetNbSurfaces(in long theNb);
470 Gets the number of isometric surfaces
472 long GetNbSurfaces();
474 //-------------------------------------------------------
475 /*! \brief Interface of the vector presentation.
477 This interface contains presentation parameters of the vector.
479 interface Vectors : DeformedShape{
481 Sets the width of the line of the vector.
483 void SetLineWidth(in double theWidth);
485 Gets the width of the line of the vector.
487 double GetLineWidth();
489 This enumeration contains a set of elements defining the type of representation of the vector head.
491 enum GlyphType{ ARROW,
497 Sets the type of representation of the vector head.
499 void SetGlyphType(in GlyphType theType);
501 Gets the type of representation of the vector head.
503 GlyphType GetGlyphType();
505 This enumeration contains a set of elements defining the position of the vector head.
508 enum GlyphPos{ CENTER, /*!<In the center of the vector.*/
509 TAIL, /*!<In the tail of the vector.*/
510 HEAD /*!<In the head of the vector.*/
513 Sets the position of the vector head.
515 void SetGlyphPos(in GlyphPos thePos);
517 Gets the position of the vector head.
519 GlyphPos GetGlyphPos();
521 //-------------------------------------------------------
522 interface Animation : Base{
523 void addField(in SALOMEDS::SObject theObject);
525 void generatePresentations(in long theFieldNum);
526 boolean generateFrames();
529 void startAnimation();
530 void stopAnimation();
536 void gotoFrame(in long theFrame);
541 long getCurrentFrame();
543 ScalarMap getPresentation(in long theField, in long theFrame);
545 void setPresentationType(in long theFieldNum, in VISUType theType);
546 VISUType getPresentationType(in long theFieldNum);
548 void setSpeed(in long theSpeed);
551 boolean isProportional();
553 void setAnimationRange(in double theMin, in double theMax);
554 double getMinRange();
555 double getMaxRange();
556 boolean isRangeDefined();
558 void dumpTo(in string thePath);
565 void setProportional(in boolean theProp);
566 void setCycling(in boolean theCycle);
569 /*! \brief Interface %Result
571 This interface serves for inner representation of data generated in other sources. (MED object or file)
572 This data is needed for further construction of graphical presentations.
574 interface Result : Base {
576 //-------------------------------------------------------
577 interface ViewManager;
579 /*! \brief %VISU_Gen interface
581 This is the main interface of %VISU component. It is necessary for creation of
582 post-processing presentations from given %Result and %Table object reference, using the views
583 provided by %ViewManager.
585 interface VISU_Gen : Engines::Component, SALOMEDS::Driver, Base{
586 void SetCurrentStudy(in SALOMEDS::Study theStudy);
587 SALOMEDS::Study GetCurrentStudy();
589 Gets the %ViewManager which is used for creation of
590 post-processing presentations.
592 ViewManager GetViewManager();
595 Imports tables from a file and create TableAttribute in Sudy
597 SALOMEDS::SObject ImportTables(in string theFileName);
599 Imports data from a file.
601 Result ImportFile(in string theFileName);
603 Imports data from a %MED object.
605 Result ImportMed(in SALOMEDS::SObject theMedSObject);
607 Imports data from a %MED field.
609 Result ImportMedField(in SALOME_MED::FIELD theField);
611 Creates a %Mesh on the basis of the data generated in other sources (MED object or file).
613 Mesh MeshOnEntity(in Result theResult, in string theMeshName, in Entity theEntity);
614 Mesh FamilyMeshOnEntity(in Result theResult, in string theMeshName, in Entity theEntity, in string theFamilyName);
615 Mesh GroupMesh(in Result theResult, in string theMeshName, in string theGroupName);
617 Creates a scalar bar presentation.
618 \param theResult Data generated in other sources. (MED object or file)
619 \param theMeshName One of the meshes presented in MED file
620 \param theEntity Type of entity where the field is defined
621 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
622 \param theIteration Number of iteration on the field
624 ScalarMap ScalarMapOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
626 Creates a deformed shape presentation.
627 \param theResult Data generated in other sources. (MED object or file)
628 \param theMeshName One of the meshes presented in MED file
629 \param theEntity Type of entity where the field is defined
630 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
631 \param theIteration Number of iteration on the field
633 DeformedShape DeformedShapeOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
635 Creates a vector presentation.
636 \param theResult Data generated in other sources. (MED object or file)
637 \param theMeshName One of the meshes presented in MED file
638 \param theEntity Type of entity where the field is defined
639 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
640 \param theIteration Number of iteration on the field
643 Vectors VectorsOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
645 Creates an iso surface presentation.
646 \param theResult Data generated in other sources. (MED object or file)
647 \param theMeshName One of the meshes presented in MED file
648 \param theEntity Type of entity where the field is defined
649 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
650 \param theIteration Number of iteration on the field
653 IsoSurfaces IsoSurfacesOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
655 Creates an stream lines presentation.
656 \param theResult Data generated in other sources. (MED object or file)
657 \param theMeshName One of the meshes presented in MED file
658 \param theEntity Type of entity where the field is defined
659 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
660 \param theIteration Number of iteration on the field
662 StreamLines StreamLinesOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
665 Creates a presentation of cut planes.
666 \param theResult Data generated in other sources. (MED object or file)
667 \param theMeshName One of the meshes presented in MED file
668 \param theEntity Type of entity where the field is defined
669 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
670 \param theIteration Number of iteration on the field
672 CutPlanes CutPlanesOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
675 Creates a presentation of cut lines.
676 \param theResult Data generated in other sources. (MED object or file)
677 \param theMeshName One of the meshes presented in MED file
678 \param theEntity Type of entity where the field is defined
679 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
680 \param theIteration Number of iteration on the field
682 CutLines CutLinesOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
685 Creates a table presentation.
687 Table CreateTable(in string theTableEntry);
689 Creates a curve on the basis of points, whose values are taken from the table.
690 \param theTable Table containing the data for construction of curves.
691 \param HRow Index of the row in the table: abscissa of the point.
692 \param VRow Index of the row in the table: ordinate of the point.
694 Curve CreateCurve(in Table theTable, in long theHRow, in long theVRow);
696 Creates a presentation form containing an array of references to the curves.
698 Container CreateContainer();
700 Animation CreateAnimation(in View3D theView3d);
702 /*! \brief %View interface
704 Contains a set of methods used by the %View frame, which can be one of
705 the following types: 3d, Table, XY plot.
706 %View interface is a base for all types of %view interfaces.
708 interface View: Base{
710 Sets the title of the %View frame.
712 void SetTitle(in string theTitle);
714 Gets the title of the %View frame.
718 Sets background color of the %View frame.
720 void SetBackground(in SALOMEDS::Color theColor);
722 Gets background color of the %View frame.
724 SALOMEDS::Color GetBackground();
726 Minimizes to the task bar or to the bottom of the Desktop the %View frame.
730 Restores the %View frame.
734 Maximizes the %View frame.
738 Removes all presentations (presentable objects) from the %view.
742 Displays all presentations (presentable objects) in the %view.
746 Removes a definite presentation (presentable object) from the %view.
748 void Erase(in PrsObject thePrsObj);
750 Displays a definite presentation (presentable object) in the %view.
752 void Display(in PrsObject thePrsObj);
754 Allows to display only a definite presentation (presentable object) in the %view.
755 All other presentations are removed from the %view.
757 void DisplayOnly(in PrsObject thePrsObj);
766 boolean SavePicture(in string theFileName);
769 //-------------------------------------------------------
770 /*! \brief 3D view interface
772 This interface contains a set of methods necessary for representation of objects in 3D space.
775 interface View3D : View {
777 This enumeration contains a set of elements determining a predefined point of view
778 (position of the camera in 3D space relative to the presentable object).
780 enum ViewType{ FRONT, BACK, LEFT, RIGHT, TOP, BOTTOM};
782 This enumeration contains a set of elements determining the axis
784 enum Axis{ XAxis, YAxis, ZAxis};
786 Data type defining coordinates in 3D space.
788 typedef double XYZ[3];
791 Makes all presentations, which are currently present in the %view, completely visible.
797 Sets a predefined point of view (FRONT, BACK, LEFT, RIGHT, TOP, BOTTOM). (In other words it means
798 a predefined position of the camera in 3D space with respect to the object which is represented.)
800 void SetView(in ViewType theType);
803 Sets the position of the camera in 3D space. This point is used as the first point of the vector defining
804 the view direction of the camera.
806 void SetPointOfView(in XYZ theCoord);
808 Gets the position of the camera in 3D space.This point is used as the first point of the vector defining
809 the view direction of the camera.
811 XYZ GetPointOfView();
813 Sets the vertical line of the camera in 3D space.
815 void SetViewUp(in XYZ theDir);
817 Gets the vertical line of the camera in 3D space.
821 Sets the point of sight of the camera. This point is used as the second point of the vector defining
822 the view direction of the camera.
824 void SetFocalPoint(in XYZ theDir);
826 Gets the point of sight of the camera. This point is used as the second point of the vector defining
827 the view direction of the camera.
831 Zooming of the presentable object. Sets the scale.
833 void SetParallelScale(in double theScale);
835 Zooming of the presentable object. Gets the scale.
837 double GetParallelScale();
839 Scaling of the view along a definite axis.
840 \param theAxis The axis of the scaling
841 \param theParam The coefficient of the scaling
843 void ScaleView(in Axis theAxis, in double theParam);
845 Removes the scaling of the view.
849 Returns True if the view parameters have been created, False if the parameters have been modified.
851 boolean SaveViewParams(in string theName);
853 Returns True if the view parameters have been found and applied to the view,
854 False if the parameters with this name don't exist.
856 boolean RestoreViewParams(in string theName);
860 //-------------------------------------------------------
861 interface TableView : View {
866 //-------------------------------------------------------
867 interface XYPlot : View {
868 void SetSubTitle(in string theTitle);
869 string GetSubTitle();
871 enum CurveType { POINTS, MULTYLINE, SPLINE};
872 void SetCurveType(in CurveType theType);
873 CurveType GetCurveType();
875 void SetMarkerSize(in long theSize);
876 long GetMarkerSize();
878 void EnableXGrid(in boolean theMajor, in long theNumMajor, in boolean theMinor, in long theNumMinor);
879 void EnableYGrid(in boolean theMajor, in long theNumMajor, in boolean theMinor, in long theNumMinor);
881 void SetHorScaling(in Scaling theScaling);
882 Scaling GetHorScaling();
883 void SetVerScaling(in Scaling theScaling);
884 Scaling GetVerScaling();
886 void SetXTitle(in string theTitle);
889 void SetYTitle(in string theTitle);
892 void ShowLegend(in boolean theShowing);
897 //-------------------------------------------------------
898 /*! \brief Interface of the %ViewManager
900 The %ViewManager is necessary for work with view windows (creation and deletion).
903 interface ViewManager: Base{
904 /*! \brief Getting an active %View Frame
906 Returns an object reference to the active %View Frame.
907 Type of the %View must be checked.
908 \note <BR>Returns nil if there are no views currently opened.
911 View GetCurrentView();
912 /*! \brief Creation of a 3d %View.
914 Returns an object reference to the newly created 3d %View.
916 View3D Create3DView();
918 TableView CreateTableView(in Table theTable);
920 XYPlot CreateXYPlot();
922 void Destroy(in View theView);