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};
35 This enumeration contains a set of elements defining the type of the module.
38 TCURVE, TTABLE, TCONTAINER, TMESH, TSCALARMAP,
39 TISOSURFACE, TDEFORMEDSHAPE, TCUTPLANES, TCUTLINES, TVECTORS, TSTREAMLINES,
40 TVISUGEN, TVIEWMANAGER, TRESULT,
41 TXYPLOT, TTABLEVIEW, TVIEW3D,
42 TENTITY, TFAMILY, TGROUP, TFIELD, TTIMESTAMP,
46 Returns ID of the object.
50 Returns the type of the presentable object
54 /*! \brief Presentable object interface
56 It is the root class of all presentable objects.
58 interface PrsObject : Base{
60 //-------------------------------------------------------
61 /*! \brief %Table representation interface
63 Presentation parameters of the %Table view.
65 interface Table : PrsObject {
67 Sets the title of the table.
69 void SetTitle(in string theTitle);
71 Gets the title of the table.
75 This enumeration contains a set of elements defining the orientation of the table.
77 enum Orientation{ HORIZONTAL, /*!<Horizontal orientation of the table.*/
78 VERTIACAL /*!<Vertical orientation of the table.*/
81 Sets orientation of the table.
83 void SetOrientation(in Orientation theOrientation);
85 Gets orientation of the table.
87 Orientation GetOrientation();
89 Gets the number of rows of the table
93 Gets the number of columns of the table
97 //-------------------------------------------------------
98 /*! \brief Interface of curve representation.
100 Manages presentation parameters of one curve.
101 It can be used for presentation of a set of curves using a combined presentation.
103 interface Curve : PrsObject{
105 Sets the title of the curve.
107 void SetTitle(in string theTitle);
109 Gets the title of the curve.
113 Sets the color of the curve.
115 void SetColor(in SALOMEDS::Color theColor);
117 Gets the color of the curve.
119 SALOMEDS::Color GetColor();
121 This enumeration contains a set of elements defining the representation type of markers (data points) with help of
122 which the curve is constructed on the graphics.
124 enum MarkerType{ NONE, CIRCLE, RECTANGLE, DIAMOND,
125 DTRIANGLE, UTRIANGLE, LTRIANGLE, RTRIANGLE,
128 Sets the representation type of markers (data points) with help of
129 which the curve is constructed on the graphics.
131 void SetMarker(in MarkerType theType);
133 Gets the representation type of markers (data points) with help of
134 which the curve is constructed on the graphics.
136 MarkerType GetMarker();
138 This enumeration contains a set of elements defining the
139 type of representation of curve lines on the graphics.
141 enum LineType{ VOIDLINE, SOLIDLINE, DASHLINE, DOTLINE, DASHDOTLINE, DASHDOTDOTLINE};
143 Sets the type of representation of curve lines on the graphics.
145 void SetLine(in LineType theType, in long theLineWidth);
147 Gets the type of representation of curve lines on the graphics.
152 Gets the width of the curve line.
156 //-------------------------------------------------------
157 /*! \brief The %Container presentable object interface
158 This interface contains a set of methods used for management of a group of curves
159 which are stored in the container.
161 interface Container : PrsObject{
163 Adds a curve into the container.
165 void AddCurve(in Curve theCurve);
167 Removes a curve from the container.
169 void RemoveCurve(in Curve theCurve);
171 Gets the number of curves which are stored in the container.
175 Removes all curves from the container.
180 //-------------------------------------------------------
181 interface Prs3d : PrsObject{
185 This enumeration contains a set of elements defining the
186 type of representation of the mesh.
189 enum PresentationType{ POINT,
194 /*! \brief Interface of the mesh.
196 This interface manages the presentation parameters of the mesh.
198 interface Mesh : Prs3d{
200 Sets the color of mesh cells.
202 void SetCellColor(in SALOMEDS::Color theColor);
204 Gets the color of mesh cells.
206 SALOMEDS::Color GetCellColor();
208 Sets the color of mesh nodes.
210 void SetNodeColor(in SALOMEDS::Color theColor);
212 Gets the color of mesh nodes.
214 SALOMEDS::Color GetNodeColor();
217 Sets the color of mesh links.
219 void SetLinkColor(in SALOMEDS::Color theColor);
221 Gets the color of mesh links.
223 SALOMEDS::Color GetLinkColor();
225 Sets the type of representation of the mesh.
227 void SetPresentationType(in PresentationType theType);
229 Gets the type of representation of the mesh.
231 PresentationType GetPresentationType();
233 //-------------------------------------------------------
234 /*! \brief Interface of the %Scalar Map presentation
236 This interface contains presentation parameters of the ScalarMap presentation
238 interface ScalarMap : Prs3d{
239 void SetScalarMode(in long theScaling);
240 long GetScalarMode();
241 void SetScaling(in Scaling theScaling);
243 Gets the type of scaling of the values reflected by this presentation.
245 Scaling GetScaling();
247 Sets scalar range - min and max boundaries of this presentable object.
248 \param theMin Min boundary of this presentable object.
249 \param theMax Max boundary of this presentable object.
251 void SetRange(in double theMin, in double theMax);
253 Gets the min boundary of this presentable object.
257 Gets the max boundary of this presentable object.
261 /*! %Orientation of this presentable object. */
263 HORIZONTAL, /*!< Horizontal orientation of this presentable object.*/
264 VERTICAL /*!< Vertical orientation of this presentable object.*/
267 Sets the type of orientation of this presentable object.
269 void SetOrientation(in Orientation theOrientation);
271 Gets the type of orientation of this presentable object.
273 Orientation GetOrientation();
275 /*! \brief Position of this presentable object.
277 Sets the position of this presentable object origin on the screen.
278 \param X Horizontal position. The value can be between 0 and 1.
279 \param Y Vertical position. The value can be between 0 and 1.
281 void SetPosition(in double X, in double Y);
283 Gets horizontal position of this presentable object origin.
287 Gets vertical position of this presentable object origin.
290 /*! \brief Size of this presentable object.
292 Sets the size of the scalar bar.
293 \param theWidth Width of this presentable object. The value can be between 0 and 1.
294 \param theHeight Height of this presentable object. The value can be between 0 and 1.
296 void SetSize(in double theWidth, in double theHeight);
298 Gets the width of this presentable object.
302 Gets the height of this presentable object.
306 Sets the number of colors which will be used for presentation of this presentable object.
308 void SetNbColors(in long theNbColors);
310 Gets the number of colors which will be used for presentation of this presentable object.
314 Sets the number of labels which will be used for indication of the gradation
315 of this presentable object.
317 void SetLabels(in long theNbLabels);
319 Gets the number of labels which will be used for indication of the gradation
320 of this presentable object.
324 Sets the title of this presentable object. For scalar bar by default - the name of the selected result is used.
326 void SetTitle(in string theName);
328 Gets the title of this presentable object.
332 //-------------------------------------------------------
333 /*! \brief Deformed shape presentation interface
335 Presentation parameters of the deformed shape presentation.
337 interface DeformedShape : ScalarMap{
339 Sets the scale of the presentatable object.
341 void SetScale(in double theScale);
343 Gets the scale of the presentatable object.
347 //-------------------------------------------------------
348 /*! \brief Cut planes interface
350 Presentation parameters of Cut planes presentation.
352 interface CutPlanes : ScalarMap{
354 This enumeration contains a set of elements defining the orientation in 3D space
355 of cut planes presentation.
357 enum Orientation {XY, YZ, ZX};
359 Sets the type of orientation in 3D space of cut planes presentation.
361 void SetOrientationType(in Orientation theNb);
363 Gets the type of orientation in 3D space of cut planes presentation.
365 Orientation GetOrientationType();
366 void SetDisplacement(in double theDisp);
367 double GetDisplacement();
369 Sets the number of cut planes.
371 void SetNbPlanes(in long theNb);
373 Gets the number of cut planes.
376 /*! Rotation around X-axis.
377 Sets rotation angle of the cut plane presentation.
379 void SetRotateX(in double theAngle);
380 /*! Rotation around X-axis.
381 Gets rotation angle of the cut plane presentation.
384 /*! Rotation around Y-axis.
385 Sets rotation angle of the cut plane presentation.
387 void SetRotateY(in double theAngle);
388 /*! Rotation around Y-axis.
389 Sets rotation angle of the cut plane presentation.
393 //-------------------------------------------------------
394 /*! \brief Interface of the stream lines representation
395 This interface contains presentation parameters of
396 stream lines presentations.
398 /*! \brief Cut lines interface
400 Presentation parameters of Cut lines presentation.
402 interface CutLines : ScalarMap{
404 void SetOrientationType(in CutPlanes::Orientation theNb);
405 void SetOrientationType2(in CutPlanes::Orientation theNb);
407 CutPlanes::Orientation GetOrientationType();
408 CutPlanes::Orientation GetOrientationType2();
410 void SetDisplacement(in double theDisp);
411 void SetDisplacement2(in double theDisp);
413 double GetDisplacement();
414 double GetDisplacement2();
416 void SetNbLines(in long theNb);
419 void SetRotateX(in double theAngle);
420 void SetRotateX2(in double theAngle);
423 double GetRotateX2();
425 void SetRotateY(in double theAngle);
426 void SetRotateY2(in double theAngle);
429 double GetRotateY2();
432 interface StreamLines : DeformedShape{
433 enum Direction{ FORWARD,
438 void SetDirection(in Direction theDirection);
439 Direction GetDirection();
441 void SetStepLength(in double theStep);
442 double GetStepLength();
444 void SetPropagationTime(in double theTime);
445 double GetPropagationTime();
447 void SetIntegrationStep(in double theStep);
448 double GetIntegrationStep();
450 void SetSource(in Prs3d thePrs3d);
453 void SetUsedPoints(in double thePercents);
454 double GetUsedPoints();
458 /*! \brief Interface of the isometric surface representation
460 This interface contains presentation parameters of
461 isometric surface presentations.
463 interface IsoSurfaces : ScalarMap{
465 Sets the number of isometric surfaces.
467 void SetNbSurfaces(in long theNb);
469 Gets the number of isometric surfaces
471 long GetNbSurfaces();
473 //-------------------------------------------------------
474 /*! \brief Interface of the vector presentation.
476 This interface contains presentation parameters of the vector.
478 interface Vectors : DeformedShape{
480 Sets the width of the line of the vector.
482 void SetLineWidth(in double theWidth);
484 Gets the width of the line of the vector.
486 double GetLineWidth();
488 This enumeration contains a set of elements defining the type of representation of the vector head.
490 enum GlyphType{ ARROW,
496 Sets the type of representation of the vector head.
498 void SetGlyphType(in GlyphType theType);
500 Gets the type of representation of the vector head.
502 GlyphType GetGlyphType();
504 This enumeration contains a set of elements defining the position of the vector head.
507 enum GlyphPos{ CENTER, /*!<In the center of the vector.*/
508 TAIL, /*!<In the tail of the vector.*/
509 HEAD /*!<In the head of the vector.*/
512 Sets the position of the vector head.
514 void SetGlyphPos(in GlyphPos thePos);
516 Gets the position of the vector head.
518 GlyphPos GetGlyphPos();
520 //-------------------------------------------------------
521 interface Animation : Base{
522 void addField(in SALOMEDS::SObject theObject);
524 void generatePresentations(in long theFieldNum);
525 boolean generateFrames();
528 void startAnimation();
529 void stopAnimation();
535 void gotoFrame(in long theFrame);
540 long getCurrentFrame();
542 ScalarMap getPresentation(in long theField, in long theFrame);
544 void setPresentationType(in long theFieldNum, in VISUType theType);
545 VISUType getPresentationType(in long theFieldNum);
547 void setSpeed(in long theSpeed);
550 boolean isProportional();
552 void setAnimationRange(in double theMin, in double theMax);
553 double getMinRange();
554 double getMaxRange();
555 boolean isRangeDefined();
557 void dumpTo(in string thePath);
564 void setProportional(in boolean theProp);
565 void setCycling(in boolean theCycle);
568 /*! \brief Interface %Result
570 This interface serves for inner representation of data generated in other sources. (MED object or file)
571 This data is needed for further construction of graphical presentations.
573 interface Result : Base {
575 //-------------------------------------------------------
576 interface ViewManager;
578 /*! \brief %VISU_Gen interface
580 This is the main interface of %VISU component. It is necessary for creation of
581 post-processing presentations from given %Result and %Table object reference, using the views
582 provided by %ViewManager.
584 interface VISU_Gen : Engines::Component, SALOMEDS::Driver, Base{
585 void SetCurrentStudy(in SALOMEDS::Study theStudy);
586 SALOMEDS::Study GetCurrentStudy();
588 Gets the %ViewManager which is used for creation of
589 post-processing presentations.
591 ViewManager GetViewManager();
594 Imports tables from a file and create TableAttribute in Sudy
596 SALOMEDS::SObject ImportTables(in string theFileName);
598 Imports data from a file.
600 Result ImportFile(in string theFileName);
602 Imports data from a %MED object.
604 Result ImportMed(in SALOMEDS::SObject theMedSObject);
606 Imports data from a %MED field.
608 Result ImportMedField(in SALOME_MED::FIELD theField);
610 Creates a %Mesh on the basis of the data generated in other sources (MED object or file).
612 Mesh MeshOnEntity(in Result theResult, in string theMeshName, in Entity theEntity);
613 Mesh FamilyMeshOnEntity(in Result theResult, in string theMeshName, in Entity theEntity, in string theFamilyName);
614 Mesh GroupMesh(in Result theResult, in string theMeshName, in string theGroupName);
616 Creates a scalar bar presentation.
617 \param theResult Data generated in other sources. (MED object or file)
618 \param theMeshName One of the meshes presented in MED file
619 \param theEntity Type of entity where the field is defined
620 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
621 \param theIteration Number of iteration on the field
623 ScalarMap ScalarMapOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
625 Creates a deformed shape presentation.
626 \param theResult Data generated in other sources. (MED object or file)
627 \param theMeshName One of the meshes presented in MED file
628 \param theEntity Type of entity where the field is defined
629 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
630 \param theIteration Number of iteration on the field
632 DeformedShape DeformedShapeOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
634 Creates a vector presentation.
635 \param theResult Data generated in other sources. (MED object or file)
636 \param theMeshName One of the meshes presented in MED file
637 \param theEntity Type of entity where the field is defined
638 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
639 \param theIteration Number of iteration on the field
642 Vectors VectorsOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
644 Creates an iso surface presentation.
645 \param theResult Data generated in other sources. (MED object or file)
646 \param theMeshName One of the meshes presented in MED file
647 \param theEntity Type of entity where the field is defined
648 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
649 \param theIteration Number of iteration on the field
652 IsoSurfaces IsoSurfacesOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
654 Creates an stream lines presentation.
655 \param theResult Data generated in other sources. (MED object or file)
656 \param theMeshName One of the meshes presented in MED file
657 \param theEntity Type of entity where the field is defined
658 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
659 \param theIteration Number of iteration on the field
661 StreamLines StreamLinesOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
664 Creates a presentation of cut planes.
665 \param theResult Data generated in other sources. (MED object or file)
666 \param theMeshName One of the meshes presented in MED file
667 \param theEntity Type of entity where the field is defined
668 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
669 \param theIteration Number of iteration on the field
671 CutPlanes CutPlanesOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
674 Creates a presentation of cut lines.
675 \param theResult Data generated in other sources. (MED object or file)
676 \param theMeshName One of the meshes presented in MED file
677 \param theEntity Type of entity where the field is defined
678 \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
679 \param theIteration Number of iteration on the field
681 CutLines CutLinesOnField(in Result theResult, in string theMeshName, in Entity theEntity, in string theFieldName, in double theIteration);
684 Creates a table presentation.
686 Table CreateTable(in string theTableEntry);
688 Creates a curve on the basis of points, whose values are taken from the table.
689 \param theTable Table containing the data for construction of curves.
690 \param HRow Index of the row in the table: abscissa of the point.
691 \param VRow Index of the row in the table: ordinate of the point.
693 Curve CreateCurve(in Table theTable, in long theHRow, in long theVRow);
695 Creates a presentation form containing an array of references to the curves.
697 Container CreateContainer();
699 Animation CreateAnimation(in View3D theView3d);
701 /*! \brief %View interface
703 Contains a set of methods used by the %View frame, which can be one of
704 the following types: 3d, Table, XY plot.
705 %View interface is a base for all types of %view interfaces.
707 interface View: Base{
709 Sets the title of the %View frame.
711 void SetTitle(in string theTitle);
713 Gets the title of the %View frame.
717 Sets background color of the %View frame.
719 void SetBackground(in SALOMEDS::Color theColor);
721 Gets background color of the %View frame.
723 SALOMEDS::Color GetBackground();
725 Minimizes to the task bar or to the bottom of the Desktop the %View frame.
729 Restores the %View frame.
733 Maximizes the %View frame.
737 Removes all presentations (presentable objects) from the %view.
741 Displays all presentations (presentable objects) in the %view.
745 Removes a definite presentation (presentable object) from the %view.
747 void Erase(in PrsObject thePrsObj);
749 Displays a definite presentation (presentable object) in the %view.
751 void Display(in PrsObject thePrsObj);
753 Allows to display only a definite presentation (presentable object) in the %view.
754 All other presentations are removed from the %view.
756 void DisplayOnly(in PrsObject thePrsObj);
765 boolean SavePicture(in string theFileName);
768 //-------------------------------------------------------
769 /*! \brief 3D view interface
771 This interface contains a set of methods necessary for representation of objects in 3D space.
774 interface View3D : View {
776 This enumeration contains a set of elements determining a predefined point of view
777 (position of the camera in 3D space relative to the presentable object).
779 enum ViewType{ FRONT, BACK, LEFT, RIGHT, TOP, BOTTOM};
781 This enumeration contains a set of elements determining the axis
783 enum Axis{ XAxis, YAxis, ZAxis};
785 Data type defining coordinates in 3D space.
787 typedef double XYZ[3];
790 Makes all presentations, which are currently present in the %view, completely visible.
796 Sets a predefined point of view (FRONT, BACK, LEFT, RIGHT, TOP, BOTTOM). (In other words it means
797 a predefined position of the camera in 3D space with respect to the object which is represented.)
799 void SetView(in ViewType theType);
802 Sets the position of the camera in 3D space. This point is used as the first point of the vector defining
803 the view direction of the camera.
805 void SetPointOfView(in XYZ theCoord);
807 Gets the position of the camera in 3D space.This point is used as the first point of the vector defining
808 the view direction of the camera.
810 XYZ GetPointOfView();
812 Sets the vertical line of the camera in 3D space.
814 void SetViewUp(in XYZ theDir);
816 Gets the vertical line of the camera in 3D space.
820 Sets the point of sight of the camera. This point is used as the second point of the vector defining
821 the view direction of the camera.
823 void SetFocalPoint(in XYZ theDir);
825 Gets the point of sight of the camera. This point is used as the second point of the vector defining
826 the view direction of the camera.
830 Zooming of the presentable object. Sets the scale.
832 void SetParallelScale(in double theScale);
834 Zooming of the presentable object. Gets the scale.
836 double GetParallelScale();
838 Scaling of the view along a definite axis.
839 \param theAxis The axis of the scaling
840 \param theParam The coefficient of the scaling
842 void ScaleView(in Axis theAxis, in double theParam);
844 Removes the scaling of the view.
848 Returns True if the view parameters have been created, False if the parameters have been modified.
850 boolean SaveViewParams(in string theName);
852 Returns True if the view parameters have been found and applied to the view,
853 False if the parameters with this name don't exist.
855 boolean RestoreViewParams(in string theName);
859 //-------------------------------------------------------
860 interface TableView : View {
865 //-------------------------------------------------------
866 interface XYPlot : View {
867 void SetSubTitle(in string theTitle);
868 string GetSubTitle();
870 enum CurveType { POINTS, MULTYLINE, SPLINE};
871 void SetCurveType(in CurveType theType);
872 CurveType GetCurveType();
874 void SetMarkerSize(in long theSize);
875 long GetMarkerSize();
877 void EnableXGrid(in boolean theMajor, in long theNumMajor, in boolean theMinor, in long theNumMinor);
878 void EnableYGrid(in boolean theMajor, in long theNumMajor, in boolean theMinor, in long theNumMinor);
880 void SetHorScaling(in Scaling theScaling);
881 Scaling GetHorScaling();
882 void SetVerScaling(in Scaling theScaling);
883 Scaling GetVerScaling();
885 void SetXTitle(in string theTitle);
888 void SetYTitle(in string theTitle);
891 void ShowLegend(in boolean theShowing);
896 //-------------------------------------------------------
897 /*! \brief Interface of the %ViewManager
899 The %ViewManager is necessary for work with view windows (creation and deletion).
902 interface ViewManager: Base{
903 /*! \brief Getting an active %View Frame
905 Returns an object reference to the active %View Frame.
906 Type of the %View must be checked.
907 \note <BR>Returns nil if there are no views currently opened.
910 View GetCurrentView();
911 /*! \brief Creation of a 3d %View.
913 Returns an object reference to the newly created 3d %View.
915 View3D Create3DView();
917 TableView CreateTableView(in Table theTable);
919 XYPlot CreateXYPlot();
921 void Destroy(in View theView);