From 80b42263d5e60eef256c66ddb919f26108024c43 Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 28 Feb 2011 14:56:19 +0000 Subject: [PATCH] Rename Engines::Component to Engines::EngineComponent --- idl/VISU_Gen.idl | 256 ++++----- src/ENGINE/VISU_Engine_i.cc | 297 ++++++----- src/VISUGUI/VisuGUI_Tools.cxx | 92 ++-- src/VISU_I/VISU_Gen_i.cc | 727 +++++++++++++------------- src/VISU_I/VISU_Result_i.cc | 953 +++++++++++++++++----------------- 5 files changed, 1160 insertions(+), 1165 deletions(-) diff --git a/idl/VISU_Gen.idl b/idl/VISU_Gen.idl index cadc44b5..a5949704 100644 --- a/idl/VISU_Gen.idl +++ b/idl/VISU_Gen.idl @@ -19,10 +19,9 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - // File : VISU_Gen.idl // Author : Alexey Petrov -// + /*! \file VISU_Gen.idl This file conatins a set of interfaces of the %VISU module. * This module provides various forms of data visualization in %SALOME application. * These forms include data tables, XY plots, 3d representations @@ -54,8 +53,8 @@ module VISU { * of the scaling, which can be applied on different presentations. */ enum Scaling{ LINEAR, /*!< Linear type of scaling. */ - LOGARITHMIC /*!< Logarithmic type of scaling. */ - }; + LOGARITHMIC /*!< Logarithmic type of scaling. */ + }; /*! * This enumeration contains a set of elements defining @@ -189,7 +188,7 @@ module VISU { boolean isAuto; string name; }; - + interface Base { /*! * Returns ID of the object. @@ -260,15 +259,15 @@ module VISU { * which the curve is constructed on the graphics. */ enum MarkerType { NONE, - CIRCLE, - RECTANGLE, - DIAMOND, - DTRIANGLE, - UTRIANGLE, - LTRIANGLE, - RTRIANGLE, - CROSS, - XCROSS + CIRCLE, + RECTANGLE, + DIAMOND, + DTRIANGLE, + UTRIANGLE, + LTRIANGLE, + RTRIANGLE, + CROSS, + XCROSS }; /*! @@ -352,7 +351,7 @@ module VISU { * * This is a root class for all 3D presentations, which can be displayed in %VISU module. */ - interface Prs3d : PrsObject, SALOME::GenericObj + interface Prs3d : PrsObject, SALOME::GenericObj { /*! * Move the 3D presentation according to the given offset parameters @@ -407,12 +406,12 @@ module VISU { * type of presentation of the mesh. */ enum PresentationType{ POINT, - WIREFRAME, - SHADED, - INSIDEFRAME, - SURFACEFRAME, - FEATURE_EDGES, - SHRINK + WIREFRAME, + SHADED, + INSIDEFRAME, + SURFACEFRAME, + FEATURE_EDGES, + SHRINK }; /*! @@ -480,8 +479,8 @@ module VISU { /*! * Sets the type of representation of a 2D quadratic mesh elements. * \param theType The type of representation of 2D quadratic mesh elements. - * This parameter is taken from - * Quadratic2DPresentationType enumeration. + * This parameter is taken from + * Quadratic2DPresentationType enumeration. */ void SetQuadratic2DPresentationType(in Quadratic2DPresentationType theType); @@ -490,7 +489,7 @@ module VISU { * \return The type of representation of the 2D quadratic mesh elements. */ Quadratic2DPresentationType GetQuadratic2DPresentationType(); - + /*! * Switches shrink mode of presentation * Note: SetPresentationType(SHRINK) is same as SetShrink(True) @@ -540,7 +539,7 @@ module VISU { /*! * Gets the min boundary of the scalar bar from source data. */ - double GetSourceMin(); + double GetSourceMin(); /*! * Gets the max boundary of the scalar bar from source data. @@ -660,7 +659,7 @@ module VISU { */ long GetScalarMode(); - /*! + /*! * Set the visibility of a distribution curve. * \param theIs is used to switch on/off the visibility of a distribution curve. */ @@ -692,7 +691,7 @@ module VISU { * \param theGroupName - group name */ void AddMeshOnGroup(in string theGroupName); - + /*! * PrsMerger method: * Remove all groups.(The scalar map will be placed on all mesh). @@ -730,8 +729,8 @@ module VISU { * Apply input parameters to last visited presentation in the cache. */ boolean Apply(in ColoredPrs3d thePrs3d, - in BasicInput theInput, - in View3D theView3D); + in BasicInput theInput, + in View3D theView3D); /*! * Gets the last visited presentation in the cache. @@ -743,7 +742,7 @@ module VISU { */ VISUType GetPrsType(); - /*! Defines timestamp representation. + /*! Defines timestamp representation. */ struct TimeStampInfo { @@ -751,7 +750,7 @@ module VISU { long myNumber; }; - /*! Defines representation range of timestamps. + /*! Defines representation range of timestamps. */ typedef sequence TimeStampsRange; @@ -816,12 +815,12 @@ module VISU { /*! Creates %ColoredPrs3dHolder.*/ ColoredPrs3dHolder CreateHolder(in VISUType theType, - in ColoredPrs3dHolder::BasicInput theInput); + in ColoredPrs3dHolder::BasicInput theInput); /*! Gets a memory which is required to create a holder. */ EnlargeType GetRequiredMemory(in VISUType theType, - in ColoredPrs3dHolder::BasicInput theInput, - out float theRequiredMemory); + in ColoredPrs3dHolder::BasicInput theInput, + out float theRequiredMemory); }; @@ -834,7 +833,7 @@ module VISU { * bar is displayed along with each colored field presentation and serves for * consulting the correspondance between colors and data values. */ - + interface ScaledPrs3d { /*! * Sets the type of scaling of the values reflected by the scalar bar. @@ -889,7 +888,7 @@ module VISU { * Presentation parameters of the Gauss Points presentation. */ //------------------------------------------------------- - interface GaussPoints : ColoredPrs3d + interface GaussPoints : ColoredPrs3d { //! Set flag indicating which scalar bar is active. void SetIsActiveLocalScalarBar(in boolean theFlag); @@ -908,7 +907,7 @@ module VISU { //! Get value of the distance between global and local scalar bars. double GetSpacing(); - + /*! * Returns visibility state of scalar bar */ @@ -919,7 +918,7 @@ module VISU { */ void SetBarVisible(in boolean theVisible); - /*! + /*! * Set the Multicolored mode. * \param theIsColored is used to switch between Results and Geometry modes. * Multiple colors are using when the presentation is @@ -968,7 +967,7 @@ module VISU { /*! * This enumeration contains a set of elements defining the type of representation of the vector head. */ - enum PrimitiveType { + enum PrimitiveType { SPRITE, POINT, SPHERE @@ -1042,8 +1041,8 @@ module VISU { //! Defines how many faces of can be drawn in the Geometrical Sphere primitive mode long GetFaceLimit(); - - + + }; @@ -1080,7 +1079,7 @@ module VISU { * * Presentation parameters of the deformed shape presentation. */ - interface DeformedShape : MonoColorPrs + interface DeformedShape : MonoColorPrs { /*! * Sets the scale of the presentatable object. @@ -1118,7 +1117,7 @@ module VISU { * \param theFieldName - the name of vectorial field */ void SetVectorialField(in Entity theEntity, - in string theFieldName); + in string theFieldName); /*! * Get vectorial entity @@ -1129,7 +1128,7 @@ module VISU { * Get scalar field name */ string GetVectorialFieldName(); - + }; //------------------------------------------------------- @@ -1157,7 +1156,7 @@ module VISU { * Presentation parameters of the scalar map on deformed shape presentation. */ interface DeformedShapeAndScalarMap : ScalarMap { - + /*! * Sets the scale of the presentatable object. * \param theScale Double value defining the scale of this presentable object. @@ -1176,8 +1175,8 @@ module VISU { * \param theTimeStampNumber - the timestamp number for the scalar field */ void SetScalarField(in Entity theEntity, - in string theFieldName, - in long theTimeStampNumber); + in string theFieldName, + in long theTimeStampNumber); /*! @@ -1248,8 +1247,8 @@ module VISU { * the type of orientation in 3D space of the cutting plane. */ enum Orientation { XY, /*!< The object is located in the plane formed by X and Y axis. */ - YZ, /*!< The object is located in the plane formed by Y and Z axis. */ - ZX }; /*!< The object is located in the plane formed by Z and X axis. */ + YZ, /*!< The object is located in the plane formed by Y and Z axis. */ + ZX }; /*!< The object is located in the plane formed by Z and X axis. */ /*! * Sets the orientation in 3D space of cutting plane for the presentation. @@ -1285,7 +1284,7 @@ module VISU { * \param theIsRelative Define, whether the input position is relative. */ void SetPlanePosition (in double thePlanePosition, - in boolean theIsRelative); + in boolean theIsRelative); /*! * Gets the position of the cutting plane @@ -1405,7 +1404,7 @@ module VISU { */ enum Orientation {XY, /*!< The object is located in the plane formed by X and Y axis. */ YZ, /*!< The object is located in the plane formed by Y and Z axis. */ - ZX}; /*!< The object is located in the plane formed by Z and X axis. */ + ZX}; /*!< The object is located in the plane formed by Z and X axis. */ /*! * Sets the type of orientation in 3D space of cut planes presentation. @@ -1714,8 +1713,8 @@ module VISU { * for definition of direction of the stream lines. */ enum Direction{ FORWARD, - BACKWARD, - BOTH + BACKWARD, + BOTH }; /*! Sets the parameters of the stream lines presentation. @@ -1739,11 +1738,11 @@ module VISU { * \return True if all parameters are properly set. */ boolean SetParams(in double theIntStep, - in double thePropogationTime, - in double theStepLength, - in Prs3d thePrs3d, - in double thePercents, - in Direction theDirection); + in double thePropogationTime, + in double theStepLength, + in Prs3d thePrs3d, + in double thePercents, + in Direction theDirection); /*! Gets the value of integration step of the stream lines presentation. */ @@ -1883,15 +1882,15 @@ module VISU { *
Time stamp represents a subfield: the results * of calculations are taken in one definite moment. */ - interface Animation : Base + interface Animation : Base { /*! * This enumeration contains a set of available animation modes. */ enum AnimationMode{ PARALLEL, /*!< parallel mode of animation. */ - SUCCESSIVE /*!< succcessive mode of animation. */ + SUCCESSIVE /*!< succcessive mode of animation. */ }; - + /*! Defines the field which will be used as a base for generation of the animation. * \param theObject The %SObject corresponding to the field. */ @@ -2108,7 +2107,7 @@ module VISU { void restoreFromStudy(in SALOMEDS::SObject theSObj); boolean isSavedInStudy(); - + /*! * Sets the animation mode. * \param theMode The value of this parameter is taken from the AnimationMode enumeration. @@ -2133,7 +2132,7 @@ module VISU { raises (SALOME::SALOME_Exception); }; - + //------------------------------------------------------- interface XYPlot; @@ -2141,7 +2140,7 @@ module VISU { /*! \brief Interface %Evolution * */ - interface Evolution : Base + interface Evolution : Base { /*! * Defines the field which will be used as a base for generation of the evolution. @@ -2180,7 +2179,7 @@ module VISU { * in other sources (MED object or file). This data is needed * for further construction of graphical presentations. */ - interface Result : RemovableObject, SALOME::GenericObj + interface Result : RemovableObject, SALOME::GenericObj { /*! Reads all data from the corresponding sources. By default the data is loaded on demand. */ @@ -2251,7 +2250,8 @@ module VISU { long GetNumberOfComponents(in EntityName theMeshName, in Entity theEntity, in EntityName theFieldName); /*! Gets existing numbers of time stamps for the given mesh name, entity and name of field */ - TimeStampNumbers GetTimeStampNumbers(in EntityName theMeshName, in Entity theEntity, in EntityName theFieldName); + TimeStampNumbers GetTimeStampNumbers(in EntityName theMeshName, in Entity theEntity, + in EntityName theFieldName); /*! Gets time values of time stamps for the given mesh name, entity and name of field */ double_array GetTimeStampValues(in EntityName theMeshName, in Entity theEntity, in EntityName theFieldName); @@ -2267,7 +2267,7 @@ module VISU { /*! Gets current resolution of multi resolution structure for the given mesh and part names */ void SetResolution(in EntityName theMeshName, in EntityName thePartName, in Resolution theResolution); - + /*! Gets information about imported MED file */ SALOME_MED::MedFileInfo GetMEDFileInfo(); @@ -2284,7 +2284,7 @@ module VISU { * post-processing presentations from given %Result and %Table object reference, * using the views provided by %ViewManager. */ - interface VISU_Gen : Engines::Component, SALOMEDS::Driver, Base + interface VISU_Gen : Engines::EngineComponent, SALOMEDS::Driver, Base { /*! Sets a definite study to be current. */ @@ -2351,18 +2351,18 @@ module VISU { * \param theNewName Name to be given to the study object. */ void RenameEntityInStudy(in Result theResult, - in string theMeshName, - in Entity theEntity, - in string theNewName); + in string theMeshName, + in Entity theEntity, + in string theNewName); void RenameFamilyInStudy(in Result theResult, - in string theMeshName, - in Entity theEntity, - in string theSubMeshName, - in string theNewName); + in string theMeshName, + in Entity theEntity, + in string theSubMeshName, + in string theNewName); void RenameGroupInStudy(in Result theResult, - in string theMeshName, - in string theSubMeshName, - in string theNewName); + in string theMeshName, + in string theSubMeshName, + in string theNewName); /*! * Creates a mesh on the basis of the data generated in other sources (MED object or file). @@ -2380,7 +2380,7 @@ module VISU { * \param theEntity Type of entity where the field is defined. */ Mesh FamilyMeshOnEntity(in Result theResult, in string theMeshName, - in Entity theEntity, in string theFamilyName); + in Entity theEntity, in string theFamilyName); /*! * Creates a mesh on the basis of a group of families. @@ -2399,8 +2399,8 @@ module VISU { * \param theTimeStampNumber Number of iteration on the field */ ScalarMap ScalarMapOnField(in Result theResult, in string theMeshName, - in Entity theEntity, in string theFieldName, - in long theTimeStampNumber); + in Entity theEntity, in string theFieldName, + in long theTimeStampNumber); /*! * Creates a Gauss Points presentation. @@ -2411,8 +2411,8 @@ module VISU { * \param theTimeStampNumber Number of iteration on the field */ GaussPoints GaussPointsOnField(in Result theResult, in string theMeshName, - in Entity theEntity, in string theFieldName, - in long theTimeStampNumber); + in Entity theEntity, in string theFieldName, + in long theTimeStampNumber); /*! * Creates a deformed shape presentation. @@ -2423,8 +2423,8 @@ module VISU { * \param theTimeStampNumber Number of iteration on the field */ DeformedShape DeformedShapeOnField(in Result theResult, in string theMeshName, - in Entity theEntity, in string theFieldName, - in long theTimeStampNumber); + in Entity theEntity, in string theFieldName, + in long theTimeStampNumber); /*! * Creates a deformed shape presentation. This function is obsolete. Use DeformedShapeAndScalarMapOnField instead. @@ -2435,8 +2435,8 @@ module VISU { * \param theTimeStampNumber Number of iteration on the field */ DeformedShapeAndScalarMap ScalarMapOnDeformedShapeOnField(in Result theResult, in string theMeshName, - in Entity theEntity, in string theFieldName, - in long theTimeStampNumber); + in Entity theEntity, in string theFieldName, + in long theTimeStampNumber); /*! * Creates a deformed shape presentation. @@ -2447,8 +2447,8 @@ module VISU { * \param theTimeStampNumber Number of iteration on the field */ DeformedShapeAndScalarMap DeformedShapeAndScalarMapOnField(in Result theResult, in string theMeshName, - in Entity theEntity, in string theFieldName, - in long theTimeStampNumber); + in Entity theEntity, in string theFieldName, + in long theTimeStampNumber); /*! * Creates a vector presentation. @@ -2459,8 +2459,8 @@ module VISU { * \param theTimeStampNumber Number of iteration on the field */ Vectors VectorsOnField(in Result theResult, in string theMeshName, - in Entity theEntity, in string theFieldName, - in long theTimeStampNumber); + in Entity theEntity, in string theFieldName, + in long theTimeStampNumber); /*! * Creates an iso surface presentation. @@ -2471,8 +2471,8 @@ module VISU { * \param theTimeStampNumber Number of iteration on the field */ IsoSurfaces IsoSurfacesOnField(in Result theResult, in string theMeshName, - in Entity theEntity, in string theFieldName, - in long theTimeStampNumber); + in Entity theEntity, in string theFieldName, + in long theTimeStampNumber); /*! * Creates an stream lines presentation. @@ -2483,8 +2483,8 @@ module VISU { * \param theTimeStampNumber Number of iteration on the field */ StreamLines StreamLinesOnField(in Result theResult, in string theMeshName, - in Entity theEntity, in string theFieldName, - in long theTimeStampNumber); + in Entity theEntity, in string theFieldName, + in long theTimeStampNumber); /*! * Creates a presentation of cut planes. @@ -2495,8 +2495,8 @@ module VISU { * \param theTimeStampNumber Number of iteration on the field */ CutPlanes CutPlanesOnField(in Result theResult, in string theMeshName, - in Entity theEntity, in string theFieldName, - in long theTimeStampNumber); + in Entity theEntity, in string theFieldName, + in long theTimeStampNumber); /*! * Creates a presentation of cut lines. @@ -2507,8 +2507,8 @@ module VISU { * \param theTimeStampNumber Number of iteration on the field */ CutLines CutLinesOnField(in Result theResult, in string theMeshName, - in Entity theEntity, in string theFieldName, - in long theTimeStampNumber); + in Entity theEntity, in string theFieldName, + in long theTimeStampNumber); /*! * Creates a presentation of cut segment. @@ -2519,8 +2519,8 @@ module VISU { * \param theTimeStampNumber Number of iteration on the field */ CutSegment CutSegmentOnField(in Result theResult, in string theMeshName, - in Entity theEntity, in string theFieldName, - in long theTimeStampNumber); + in Entity theEntity, in string theFieldName, + in long theTimeStampNumber); /*! * Creates a Plot3D presentation. @@ -2531,8 +2531,8 @@ module VISU { * \param theTimeStampNumber Number of iteration on the field */ Plot3D Plot3DOnField(in Result theResult, in string theMeshName, - in Entity theEntity, in string theFieldName, - in long theTimeStampNumber); + in Entity theEntity, in string theFieldName, + in long theTimeStampNumber); /*! * Creates a table presentation. @@ -2547,15 +2547,15 @@ module VISU { * \param theVRow Index of the row in the table: ordinate of the point. */ Curve CreateCurve(in Table theTable, in long theHRow, in long theVRow); - + /*! * Creates a curve on the basis of points, whose values are taken from the table. - * Each point has also assigned value, that will be shown as tooltip in Plot2d + * Each point has also assigned value, that will be shown as tooltip in Plot2d * \param theTable Table containing the data for construction of curves. * \param theHRow Index of the row in the table: abscissa of the point. * \param theVRow Index of the row in the table: ordinate of the point. * \param theZRow Index of the row in the table: assigned value (so-called as Z). - */ + */ Curve CreateCurveWithZ( in Table theTable, in long theHRow, in long theVRow, in long theZRow ); /*! @@ -2567,7 +2567,7 @@ module VISU { * \param theVRow Index of the row in the table: ordinate of the point. * \param theZRow Index of the row in the table: assigned value (so-called as Z). * \param theIsV2 Flag allowed to display the curve using right axis of Plot2d view. - */ + */ Curve CreateCurveWithZExt( in Table theTable, in long theHRow, in long theVRow, in long theZRow, in boolean theIsV2 ); @@ -2595,33 +2595,33 @@ module VISU { */ ColoredPrs3dCache GetColoredPrs3dCache(in SALOMEDS::Study theStudy); - + /* Clipping planes management */ - /*Create a clipping plane and return its ID (position in corresponded array) + /*Create a clipping plane and return its ID (position in corresponded array) Id of clipping plane could be changed after deletion of other clipping plane */ - long CreateClippingPlane(in double X, in double Y, in double Z, - in double dX, in double dY, in double dZ, - in boolean auto, in string name); - - void EditClippingPlane(in long id, in double X, in double Y, in double Z, - in double dX, in double dY, in double dZ, - in boolean auto, in string name); - + long CreateClippingPlane(in double X, in double Y, in double Z, + in double dX, in double dY, in double dZ, + in boolean auto, in string name); + + void EditClippingPlane(in long id, in double X, in double Y, in double Z, + in double dX, in double dY, in double dZ, + in boolean auto, in string name); + /* Returns clipping plane by its Id */ ClippingPlane GetClippingPlane(in long id); - + /* Deletes clipping plane by its Id */ boolean DeleteClippingPlane(in long id); - + /* Applyes a clipping plane with Id to presentation thePrs */ boolean ApplyClippingPlane(in Prs3d thePrs, in long id); /* Detaches a clipping plane with Id from presentation thePrs */ boolean DetachClippingPlane(in Prs3d thePrs, in long id); - - + + /* Get number of clipping planes */ long GetClippingPlanesNb(); @@ -2653,7 +2653,7 @@ module VISU { * the following types: 3d, Table, XY plot. * %View interface is a base for all types of %view interfaces. */ - interface View: Base, SALOME::GenericObj + interface View: Base, SALOME::GenericObj { /*! \brief %ViewRepresentation enumeration * @@ -2969,7 +2969,7 @@ module VISU { string SetPresentationType(in ScalarMap thePrs, in PresentationType thePrsType); - /*! Set representation type of 2D quadratic elements + /*! Set representation type of 2D quadratic elements * of the given presentation in this view. * \param thePrs Object to set a representation type of 2D quadratic elements. * \param theType Representation type of 2D quadratic elements to be set to the given object. @@ -2980,11 +2980,11 @@ module VISU { /*! Get representation type of the 2D quadratic mesh elements of given presentation in this view. * \param thePrs Object to get a representation type of 2D quadratic mesh elements. - * \return Quadratic2DPresentationType Representation type of 2D quadratic mesh elements + * \return Quadratic2DPresentationType Representation type of 2D quadratic mesh elements * in this view. - */ + */ Quadratic2DPresentationType GetQuadratic2DPresentationType(in ScalarMap thePrs); - + /*! Get shrink state of the given presentation in this view. * \param thePrs Object to get a shrink state of. @@ -3152,10 +3152,10 @@ module VISU { /*! Set range of the 2D plot to XY axis of the 2D viewer. */ void FitRange(in double xMin, in double xMax, - in double yMin, in double yMax); + in double yMin, in double yMax); void GetFitRanges(out double xMin,out double xMax, - out double yMin,out double yMax); + out double yMin,out double yMax); }; //------------------------------------------------------- diff --git a/src/ENGINE/VISU_Engine_i.cc b/src/ENGINE/VISU_Engine_i.cc index 0dc03421..37ee82ea 100644 --- a/src/ENGINE/VISU_Engine_i.cc +++ b/src/ENGINE/VISU_Engine_i.cc @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #include "VISU_Engine_i.hh" #include "utilities.h" @@ -50,9 +49,9 @@ UNEXPECT_CATCH(SalomeException, SALOME::SALOME_Exception); extern "C" { VISU_ENGINE_EXPORT - PortableServer::ObjectId * + PortableServer::ObjectId * VISUEngine_factory(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, - const char *instanceName, const char *interfaceName) + const char *instanceName, const char *interfaceName) { MESSAGE("VisuEngine_factory : "<getId() ; } @@ -70,22 +69,22 @@ VISU_ENGINE_EXPORT namespace VISU{ //=========================================================================== VISU_Gen_i::VISU_Gen_i(SALOME::Session_ptr session, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName) : + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName) : Engines_Component_i(orb, poa, contId, instanceName, interfaceName) { _thisObj = this ; _id = _poa->activate_object(_thisObj); #ifndef WIN32 - Engines::Component_var aComponent = session->GetComponent("libVISUEngineImpl.so"); + Engines::EngineComponent_var aComponent = session->GetComponent("libVISUEngineImpl.so"); #else - Engines::Component_var aComponent = session->GetComponent("VISUEngineImpl.dll"); + Engines::EngineComponent_var aComponent = session->GetComponent("VISUEngineImpl.dll"); #endif myVisuGen = VISU::VISU_Gen::_narrow(aComponent); - } + } VISU_Gen_i::~VISU_Gen_i(){ if(MYDEBUG) MESSAGE("VISU_Gen_i::~VISU_Gen_i"); @@ -97,25 +96,25 @@ namespace VISU{ //=========================================================================== bool VISU_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, - const SALOMEDS::TMPFile & theStream, - const char* theURL, - bool isMultiFile) + const SALOMEDS::TMPFile & theStream, + const char* theURL, + bool isMultiFile) { return myVisuGen->Load(theComponent,theStream,theURL,isMultiFile); } bool VISU_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent, - const SALOMEDS::TMPFile & theStream, - const char* theURL, - bool isMultiFile) + const SALOMEDS::TMPFile & theStream, + const char* theURL, + bool isMultiFile) { return Load(theComponent, theStream, theURL, isMultiFile); } char* VISU_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, - const char* aLocalPersistentID, - CORBA::Boolean isMultiFile, - CORBA::Boolean isASCII) + const char* aLocalPersistentID, + CORBA::Boolean isMultiFile, + CORBA::Boolean isASCII) { return myVisuGen->LocalPersistentIDToIOR(theSObject, aLocalPersistentID, isMultiFile, isASCII); } @@ -123,24 +122,24 @@ namespace VISU{ //=========================================================================== SALOMEDS::TMPFile* VISU_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, - bool isMultiFile) + const char* theURL, + bool isMultiFile) { return myVisuGen->Save(theComponent,theURL,isMultiFile); } SALOMEDS::TMPFile* VISU_Gen_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, - bool isMultiFile) + const char* theURL, + bool isMultiFile) { return myVisuGen->Save(theComponent,theURL,isMultiFile); } char* VISU_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, - const char* IORString, - CORBA::Boolean isMultiFile, - CORBA::Boolean isASCII) + const char* IORString, + CORBA::Boolean isMultiFile, + CORBA::Boolean isASCII) { return myVisuGen->IORToLocalPersistentID(theSObject, IORString, isMultiFile, isASCII); } @@ -174,7 +173,7 @@ namespace VISU{ CORBA::Boolean VISU_Gen_i::ExportTableToFile(SALOMEDS::SObject_ptr theTable, - const char* theFileName) + const char* theFileName) { return myVisuGen->ExportTableToFile(theTable, theFileName); } @@ -205,44 +204,44 @@ namespace VISU{ } - Mesh_ptr VISU_Gen_i::MeshOnEntity(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity) + Mesh_ptr VISU_Gen_i::MeshOnEntity(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity) { return myVisuGen->MeshOnEntity(theResult,theMeshName,theEntity); } - Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFamilyName) + Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFamilyName) { return myVisuGen->FamilyMeshOnEntity(theResult,theMeshName,theEntity,theFamilyName); } - Mesh_ptr VISU_Gen_i::GroupMesh(Result_ptr theResult, - const char* theMeshName, - const char* theGroupName) + Mesh_ptr VISU_Gen_i::GroupMesh(Result_ptr theResult, + const char* theMeshName, + const char* theGroupName) { return myVisuGen->GroupMesh(theResult,theMeshName,theGroupName); } - void VISU_Gen_i::RenameEntityInStudy(Result_ptr theResult, const char* theMeshName, - VISU::Entity theEntity, const char* theNewName) + void VISU_Gen_i::RenameEntityInStudy(Result_ptr theResult, const char* theMeshName, + VISU::Entity theEntity, const char* theNewName) { myVisuGen->RenameEntityInStudy(theResult,theMeshName,theEntity,theNewName); } - void VISU_Gen_i::RenameFamilyInStudy(Result_ptr theResult, const char* theMeshName, - VISU::Entity theEntity, const char* theFamilyName, - const char* theNewName) + void VISU_Gen_i::RenameFamilyInStudy(Result_ptr theResult, const char* theMeshName, + VISU::Entity theEntity, const char* theFamilyName, + const char* theNewName) { myVisuGen->RenameFamilyInStudy(theResult,theMeshName,theEntity,theFamilyName,theNewName); } - void VISU_Gen_i::RenameGroupInStudy(Result_ptr theResult, const char* theMeshName, - const char* theGroupName, const char* theNewName) + void VISU_Gen_i::RenameGroupInStudy(Result_ptr theResult, const char* theMeshName, + const char* theGroupName, const char* theNewName) { myVisuGen->RenameGroupInStudy(theResult,theMeshName,theGroupName,theNewName); } @@ -250,139 +249,139 @@ namespace VISU{ ScalarMap_ptr VISU_Gen_i - ::ScalarMapOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + ::ScalarMapOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return myVisuGen->ScalarMapOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } - GaussPoints_ptr + GaussPoints_ptr VISU_Gen_i - ::GaussPointsOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + ::GaussPointsOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return myVisuGen->GaussPointsOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } - DeformedShape_ptr + DeformedShape_ptr VISU_Gen_i - ::DeformedShapeOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + ::DeformedShapeOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return myVisuGen->DeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } - DeformedShapeAndScalarMap_ptr + DeformedShapeAndScalarMap_ptr VISU_Gen_i - ::ScalarMapOnDeformedShapeOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + ::ScalarMapOnDeformedShapeOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return DeformedShapeAndScalarMapOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } - DeformedShapeAndScalarMap_ptr + DeformedShapeAndScalarMap_ptr VISU_Gen_i - ::DeformedShapeAndScalarMapOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + ::DeformedShapeAndScalarMapOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return myVisuGen->DeformedShapeAndScalarMapOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } - Vectors_ptr + Vectors_ptr VISU_Gen_i - ::VectorsOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + ::VectorsOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return myVisuGen->VectorsOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } - IsoSurfaces_ptr + IsoSurfaces_ptr VISU_Gen_i - ::IsoSurfacesOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + ::IsoSurfacesOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return myVisuGen->IsoSurfacesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } - StreamLines_ptr + StreamLines_ptr VISU_Gen_i - ::StreamLinesOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + ::StreamLinesOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return myVisuGen->StreamLinesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } - CutPlanes_ptr + CutPlanes_ptr VISU_Gen_i - ::CutPlanesOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + ::CutPlanesOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return myVisuGen->CutPlanesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } - CutLines_ptr + CutLines_ptr VISU_Gen_i - ::CutLinesOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + ::CutLinesOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return myVisuGen->CutLinesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } - CutSegment_ptr + CutSegment_ptr VISU_Gen_i - ::CutSegmentOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + ::CutSegmentOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return myVisuGen->CutSegmentOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } - Plot3D_ptr + Plot3D_ptr VISU_Gen_i - ::Plot3DOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + ::Plot3DOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return myVisuGen->Plot3DOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } @@ -392,17 +391,17 @@ namespace VISU{ } - Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable, - CORBA::Long theHRow, - CORBA::Long theVRow) + Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable, + CORBA::Long theHRow, + CORBA::Long theVRow) { return myVisuGen->CreateCurve(theTable,theHRow,theVRow); } - Curve_ptr VISU_Gen_i::CreateCurveWithZ(Table_ptr theTable, - CORBA::Long theHRow, - CORBA::Long theVRow, - CORBA::Long theZRow) + Curve_ptr VISU_Gen_i::CreateCurveWithZ(Table_ptr theTable, + CORBA::Long theHRow, + CORBA::Long theVRow, + CORBA::Long theZRow) { return myVisuGen->CreateCurveWithZ(theTable,theHRow,theVRow,theZRow); } @@ -457,42 +456,42 @@ namespace VISU{ SALOMEDS::SObject_ptr VISU_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject, - CORBA::Object_ptr theObject, - const char* theName) - throw (SALOME::SALOME_Exception) + SALOMEDS::SObject_ptr theSObject, + CORBA::Object_ptr theObject, + const char* theName) + throw (SALOME::SALOME_Exception) { return myVisuGen->PublishInStudy(theStudy, theSObject, theObject, theName); } - + CORBA::Boolean VISU_Gen_i::CanCopy(SALOMEDS::SObject_ptr theObject) { return myVisuGen->CanCopy(theObject); } - + SALOMEDS::TMPFile* VISU_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) { return myVisuGen->CopyFrom(theObject, theObjectID); } - + CORBA::Boolean VISU_Gen_i::CanPaste(const char* theComponentName, CORBA::Long theObjectID) { return myVisuGen->CanPaste(theComponentName, theObjectID); } - + SALOMEDS::SObject_ptr VISU_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream, - CORBA::Long theObjectID, - SALOMEDS::SObject_ptr theObject) + CORBA::Long theObjectID, + SALOMEDS::SObject_ptr theObject) { return myVisuGen->PasteInto(theStream,theObjectID,theObject); } Engines::TMPFile* VISU_Gen_i::DumpPython(CORBA::Object_ptr theStudy, CORBA::Boolean theIsPublished, - CORBA::Boolean& theIsValidScript) + CORBA::Boolean& theIsValidScript) { return myVisuGen->DumpPython(theStudy, theIsPublished, theIsValidScript); - } + } VISU::ColoredPrs3dCache_ptr VISU_Gen_i:: @@ -503,44 +502,44 @@ namespace VISU{ - CORBA::Long VISU_Gen_i::CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z, - CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ, - CORBA::Boolean isAuto, const char* name) + CORBA::Long VISU_Gen_i::CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z, + CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ, + CORBA::Boolean isAuto, const char* name) { return myVisuGen->CreateClippingPlane(X, Y, Z, dX, dY, dZ, isAuto, name); } - - void VISU_Gen_i::EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z, - CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ, - CORBA::Boolean isAuto, const char* name) + + void VISU_Gen_i::EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z, + CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ, + CORBA::Boolean isAuto, const char* name) { myVisuGen->EditClippingPlane(id, X, Y, Z, dX, dY, dZ, isAuto, name); } - + /* Returns clipping plane by its Id */ VISU::ClippingPlane* VISU_Gen_i::GetClippingPlane(CORBA::Long id) { return myVisuGen->GetClippingPlane(id); } - + /* Deletes clipping plane by its Id */ CORBA::Boolean VISU_Gen_i::DeleteClippingPlane(CORBA::Long id) { return myVisuGen->DeleteClippingPlane(id); } - + /* Applyes a clipping plane with Id to presentation thePrs */ CORBA::Boolean VISU_Gen_i::ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id) { return myVisuGen->ApplyClippingPlane(thePrs, id); } - + CORBA::Boolean VISU_Gen_i::DetachClippingPlane(Prs3d_ptr thePrs, CORBA::Long id) { return myVisuGen->DetachClippingPlane(thePrs, id); } - + /* Get number of clipping planes */ CORBA::Long VISU_Gen_i::GetClippingPlanesNb() { @@ -553,7 +552,7 @@ namespace VISU{ const VISU::double_array& theTStamps ) { return myVisuGen->VTK2MED(theVTKFiles, theMEDFile, theMeshName, theTStamps); - } + } /* Load texture from file */ CORBA::Long VISU_Gen_i::LoadTexture(const char* theTextureFile) diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 343da087..6c6618ab 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -18,13 +18,12 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // VISU VISUGUI : GUI of VISU component // File : VisuGUI_Tools.cxx // Author : Sergey Anikin // Module : VISU -// + #include "VisuGUI_Tools.h" #include "VisuGUI_ViewTools.h" #include "VisuGUI_Prs3dTools.h" @@ -108,7 +107,7 @@ namespace VISU SalomeApp_Study* GetAppStudy(const CAM_Module* theModule) { - return theModule && theModule->application() ? + return theModule && theModule->application() ? dynamic_cast(theModule->application()->activeStudy()) : 0; } @@ -226,12 +225,12 @@ namespace VISU static VISU_Gen_i* aGen = 0; if(!aGen){ SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService()); - Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","VISU"); + Engines::EngineComponent_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","VISU"); VISU_Gen_var aVISU = VISU_Gen::_narrow(aComponent); if(!CORBA::is_nil(aVISU)) aGen = VISU_Gen_i::GetVisuGenImpl(); } - + if(aGen) aGen->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(theModule)))); else @@ -246,7 +245,7 @@ namespace VISU static SALOME_MED::MED_Gen_var aGen; if(CORBA::is_nil(aGen)){ SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService()); - Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","MED"); + Engines::EngineComponent_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","MED"); aGen = SALOME_MED::MED_Gen::_narrow(aComponent); } if(CORBA::is_nil(aGen)) @@ -302,7 +301,7 @@ namespace VISU if(VISU::Base_i* aBase = GetServantInterface(anObject)) anObjectInfo.myBase = aBase; } - + return anObjectInfo; } @@ -342,20 +341,20 @@ namespace VISU VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule); if(aSelectionInfo.empty()) return false; - + VISU::TSelectionItem aSelectionItem = aSelectionInfo.front(); thePrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase); if(!thePrs3d) return false; - + theViewWindow = GetActiveViewWindow(theModule); if(!theViewWindow) return false; - + thenActor = FindActor(theViewWindow, thePrs3d); if(!thenActor) return false; - + return true; } @@ -558,10 +557,9 @@ namespace VISU } } } - } - + } + thePrs->RemoveFromStudy(); - } //------------------------------------------------------------ @@ -582,7 +580,7 @@ namespace VISU TSelectionItem aSelectionItem = aSelectionInfo.front(); aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase); if(!aPrs3d) { - aTable = dynamic_cast(aSelectionItem.myObjectInfo.myBase); + aTable = dynamic_cast(aSelectionItem.myObjectInfo.myBase); if(!aTable) return; } @@ -646,20 +644,20 @@ namespace VISU TSelectionInfo aSelectionInfo = GetSelectedObjects(theModule); if(aSelectionInfo.empty()) return; - + TSelectionItem aSelectionItem = aSelectionInfo.front(); VISU::Prs3d_i* aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase); SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(theModule); - + if(!aPrs3d || !aViewWindow) return; - + VISU_Actor *anActor = FindActor(aViewWindow, aPrs3d); if(!anActor) return; - + if (VISU::Mesh_i* aMesh = dynamic_cast(aPrs3d)) { aMesh->SetQuadratic2DPresentationType(theType); RecreateActor(theModule, aMesh); @@ -676,7 +674,7 @@ namespace VISU } } } - + //------------------------------------------------------------ void SetShading ( const SalomeApp_Module* theModule, @@ -743,7 +741,7 @@ namespace VISU { if(theSource->Depth() < 3) // Bug of SALOMEDS : can\t get father from root object return NULL; - + _PTR(SObject) aSObj = theSource->GetFather(); if (!aSObj) return NULL; @@ -889,12 +887,12 @@ namespace VISU //------------------------------------------------------------ bool ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow, - vtkFloatingPointType allBounds[6], + vtkFloatingPointType allBounds[6], const char* theActorClassName) { vtkRenderer *aRen = theViewWindow->getRenderer(); VTK::ActorCollectionCopy aCopy(aRen->GetActors()); - vtkActorCollection *anActColl = aCopy.GetActors(); + vtkActorCollection *anActColl = aCopy.GetActors(); vtkProp *prop; vtkFloatingPointType *bounds; int somethingVisible = false; @@ -903,7 +901,7 @@ namespace VISU allBounds[1] = allBounds[3] = allBounds[5] = -VTK_LARGE_FLOAT; // loop through all props for (anActColl->InitTraversal(); (prop = anActColl->GetNextProp()); ) { - // if it's invisible, or has no geometry, we can skip the rest + // if it's invisible, or has no geometry, we can skip the rest if (prop->GetVisibility() && prop->IsA(theActorClassName)) { bounds = prop->GetBounds(); // make sure we haven't got bogus bounds @@ -913,12 +911,12 @@ namespace VISU bounds[4] > -VTK_LARGE_FLOAT && bounds[5] < VTK_LARGE_FLOAT) { somethingVisible = true; - if (bounds[0] < allBounds[0]) allBounds[0] = bounds[0]; - if (bounds[1] > allBounds[1]) allBounds[1] = bounds[1]; - if (bounds[2] < allBounds[2]) allBounds[2] = bounds[2]; - if (bounds[3] > allBounds[3]) allBounds[3] = bounds[3]; - if (bounds[4] < allBounds[4]) allBounds[4] = bounds[4]; - if (bounds[5] > allBounds[5]) allBounds[5] = bounds[5]; + if (bounds[0] < allBounds[0]) allBounds[0] = bounds[0]; + if (bounds[1] > allBounds[1]) allBounds[1] = bounds[1]; + if (bounds[2] < allBounds[2]) allBounds[2] = bounds[2]; + if (bounds[3] > allBounds[3]) allBounds[3] = bounds[3]; + if (bounds[4] < allBounds[4]) allBounds[4] = bounds[4]; + if (bounds[5] > allBounds[5]) allBounds[5] = bounds[5]; }//not bogus } } @@ -1033,7 +1031,7 @@ namespace VISU // implementation moved to VISU_I package (see VISU_Tools.h) VISU::PlotRemoveCurve( theModule->getApp(), pCrv ); } - + //------------------------------------------------------------ void PlotContainer(const SalomeApp_Module* theModule, @@ -1075,7 +1073,7 @@ namespace VISU CreateMesh(VisuGUI* theModule, const Handle(SALOME_InteractiveObject)& theIO, SVTK_ViewWindow* theViewWindow) - { + { _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule)); //if (CheckLock(aStudy)) // return; @@ -1316,7 +1314,7 @@ namespace VISU std::set::const_iterator aIter = aIndexes.begin(); for (int i = 1,length = aIndexes.size(); i <= length; i++) { std::set::const_iterator aIter = aIndexes.find(i); - if (aIter == aIndexes.end()) { minIndx = i; break; } + if (aIter == aIndexes.end()) { minIndx = i; break; } else minIndx = i + 1; } return minIndx; @@ -1352,7 +1350,7 @@ namespace VISU if (!aFolder) { _PTR(StudyBuilder) aBuilder = theStudy->NewBuilder(); aFolder = aBuilder->NewObject(aVisuSO); - + _PTR(GenericAttribute) anAttr; anAttr = aBuilder->FindOrCreateAttribute(aFolder,"AttributeName"); _PTR(AttributeName) aName(anAttr); @@ -1363,37 +1361,37 @@ namespace VISU } //------------------------------------------------------------ - void initSpinBox( SalomeApp_IntSpinBox* sb, - const int bottom, - const int top, + void initSpinBox( SalomeApp_IntSpinBox* sb, + const int bottom, + const int top, const int step ) { sb->setAcceptNames( false ); sb->setRange( bottom, top ); sb->setSingleStep( step ); } - + //------------------------------------------------------------ - void initSpinBox( SalomeApp_DoubleSpinBox* sb, - const double& bottom, - const double& top, - const double& step, + void initSpinBox( SalomeApp_DoubleSpinBox* sb, + const double& bottom, + const double& top, + const double& step, const char* quantity ) { // Obtain precision from preferences SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); int precision = resMgr->integerValue( "VISU", quantity, 3 ); - - sb->setPrecision ( precision ); + + sb->setPrecision ( precision ); sb->setDecimals ( qAbs(precision) ); sb->setRange ( bottom, top ); sb->setSingleStep ( step ); sb->setDefaultValue( bottom ); sb->setAcceptNames ( false ); - + // Add a hint for the user saying how to tune precision QString userPropName = QObject::tr( QString( "VISU_PREF_%1" ).arg( quantity ).toLatin1().constData() ); - sb->setProperty( "validity_tune_hint", - QVariant( QObject::tr( "VISU_PRECISION_HINT" ).arg( userPropName ) ) ); + sb->setProperty( "validity_tune_hint", + QVariant( QObject::tr( "VISU_PRECISION_HINT" ).arg( userPropName ) ) ); } } diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 240cc2d5..c120b1e3 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -18,13 +18,12 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // VISU OBJECT : interactive object for VISU entities implementation // File : VISU_Gen_i.cc // Author : Alexey PETROV // Module : VISU -// + #include "VISU_Gen_i.hh" #include "VISU_Result_i.hh" #include "VISU_PrsObject_i.hh" @@ -102,12 +101,12 @@ static int MYDEBUG = 0; using namespace std; -extern "C" +extern "C" VISU_I_EXPORT VISU::VISU_Gen_ptr GetImpl(CORBA::ORB_ptr theORB, - PortableServer::POA_ptr thePOA, - SALOME_NamingService* theNamingService, - QMutex* theMutex) + PortableServer::POA_ptr thePOA, + SALOME_NamingService* theNamingService, + QMutex* theMutex) { if(MYDEBUG) MESSAGE("extern 'C' GetImpl"); VISU::VISU_Gen_i *aVISU_Gen = new VISU::VISU_Gen_i(theORB,thePOA,theNamingService,theMutex); @@ -121,13 +120,13 @@ namespace VISU static std::string VISU_TMP_DIR; static CORBA::Boolean myIsMultiFile; - const CORBA::Boolean IsMultiFile() - { + const CORBA::Boolean IsMultiFile() + { return myIsMultiFile; } //---------------------------------------------------------------------------- - _PTR(SComponent) + _PTR(SComponent) ClientFindOrCreateVisuComponent (_PTR(Study) theStudyDocument) { _PTR(SComponent) aSComponent = theStudyDocument->FindComponent("VISU"); @@ -138,17 +137,17 @@ namespace VISU if (aLocked) theStudyDocument->GetProperties()->SetLocked(false); aSComponent = aStudyBuilder->NewComponent("VISU"); _PTR(GenericAttribute) anAttr = - aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeName"); + aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeName"); _PTR(AttributeName) aName (anAttr); CORBA::ORB_var anORB = Base_i::GetORB(); SALOME_NamingService *NamingService = new SALOME_NamingService( anORB ); CORBA::Object_var objVarN = NamingService->Resolve("/Kernel/ModulCatalog"); SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = - SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN); + SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN); SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "VISU" ); if (!Comp->_is_nil()) { - aName->SetValue(Comp->componentusername()); + aName->SetValue(Comp->componentusername()); } anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributePixMap"); @@ -165,7 +164,7 @@ namespace VISU //---------------------------------------------------------------------------- - SALOMEDS::SComponent_var + SALOMEDS::SComponent_var FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument) { SALOMEDS::SComponent_var aSComponent = theStudyDocument->FindComponent("VISU"); @@ -185,7 +184,7 @@ namespace VISU SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN); SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "VISU" ); if ( !Comp->_is_nil() ) { - aName->SetValue( Comp->componentusername() ); + aName->SetValue( Comp->componentusername() ); } anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributePixMap"); @@ -203,7 +202,7 @@ namespace VISU //---------------------------------------------------------------------------- void - RegistryStorable() + RegistryStorable() { Storable::RegistryStorableEngine(Result_i::myComment.c_str(),&(Result_i::StorableEngine)); @@ -239,7 +238,7 @@ namespace VISU if(!theFileNames.empty()){ aListOfFileNames->length(theFileNames.size()); for(int aCounter = theFileNames.size(); aCounter > 0; aCounter--) - aListOfFileNames[aCounter-1] = theFileNames[aCounter-1].c_str(); + aListOfFileNames[aCounter-1] = theFileNames[aCounter-1].c_str(); } return aListOfFileNames._retn(); } @@ -295,7 +294,7 @@ namespace VISU VTK::MarkerTexture aMarkerTexture; if( string( markerGrpName ).substr( 0, 6 ) == string( "Marker" ) ) { - aTopGroup = new HDFgroup( markerGrpName, aFile ); + aTopGroup = new HDFgroup( markerGrpName, aFile ); aTopGroup->OpenOnDisk(); aMarkerId = atoi( string( markerGrpName ).substr( 6 ).c_str() ); @@ -325,7 +324,7 @@ namespace VISU aDataset->CloseOnDisk(); } - aTopGroup->CloseOnDisk(); + aTopGroup->CloseOnDisk(); } if( aMarkerId > 0 ) @@ -423,7 +422,7 @@ namespace VISU //---------------------------------------------------------------------------- VISU_Gen_i ::VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA, - SALOME_NamingService* theNamingService, QMutex* theMutex) : + SALOME_NamingService* theNamingService, QMutex* theMutex) : Engines_Component_i() { if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : "<_this(); @@ -471,8 +470,8 @@ namespace VISU //---------------------------------------------------------------------------- void - CorrectSObjectType(SALOMEDS::SObject_ptr theSObject, - SALOMEDS::StudyBuilder_ptr theBuilder) + CorrectSObjectType(SALOMEDS::SObject_ptr theSObject, + SALOMEDS::StudyBuilder_ptr theBuilder) { SALOMEDS::GenericAttribute_var anAttr; bool isAttrStringFound = false; @@ -491,16 +490,16 @@ namespace VISU if ( isAttrStringFound || theSObject->FindAttribute(anAttr, "AttributeString") ) { SALOMEDS::AttributeString_var aAttComment = SALOMEDS::AttributeString::_narrow(anAttr); if ( aAttComment ) { - CORBA::String_var aValue = aAttComment->Value(); - std::string aString = Storable::CorrectPersistentString(aValue.in()); - aAttComment->SetValue( aString.c_str() ); + CORBA::String_var aValue = aAttComment->Value(); + std::string aString = Storable::CorrectPersistentString(aValue.in()); + aAttComment->SetValue( aString.c_str() ); } } } //---------------------------------------------------------------------------- - CORBA::Boolean + CORBA::Boolean LoadWithMarkerMap(SALOMEDS::SComponent_ptr theComponent, const SALOMEDS::TMPFile & theStream, const char* theURL, @@ -515,7 +514,7 @@ namespace VISU for (anIter->InitEx(true); anIter->More(); anIter->Next()) { SALOMEDS::SObject_var aSObject = anIter->Value(); - CorrectSObjectType(aSObject, aStudyBuilder); + CorrectSObjectType(aSObject, aStudyBuilder); } VISU_TMP_DIR = theIsMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir(); @@ -541,12 +540,12 @@ namespace VISU //---------------------------------------------------------------------------- - CORBA::Boolean + CORBA::Boolean VISU_Gen_i ::Load(SALOMEDS::SComponent_ptr theComponent, - const SALOMEDS::TMPFile & theStream, - const char* theURL, - CORBA::Boolean theIsMultiFile) + const SALOMEDS::TMPFile & theStream, + const char* theURL, + CORBA::Boolean theIsMultiFile) { Mutex mt(myMutex); return LoadWithMarkerMap(theComponent, theStream, theURL, theIsMultiFile, false, myMarkerMap); @@ -554,12 +553,12 @@ namespace VISU //---------------------------------------------------------------------------- - CORBA::Boolean + CORBA::Boolean VISU_Gen_i ::LoadASCII(SALOMEDS::SComponent_ptr theComponent, - const SALOMEDS::TMPFile & theStream, - const char* theURL, - bool theIsMultiFile) + const SALOMEDS::TMPFile & theStream, + const char* theURL, + bool theIsMultiFile) { Mutex mt(myMutex); return LoadWithMarkerMap(theComponent, theStream, theURL, theIsMultiFile, true, myMarkerMap); @@ -567,32 +566,32 @@ namespace VISU //---------------------------------------------------------------------------- - char* + char* VISU_Gen_i ::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, - const char* theLocalPersistentID, - CORBA::Boolean theIsMultiFile, - CORBA::Boolean theIsASCII) + const char* theLocalPersistentID, + CORBA::Boolean theIsMultiFile, + CORBA::Boolean theIsASCII) { CORBA::String_var aString(""); if(strcmp(theLocalPersistentID,"") != 0) { - Storable* aStorable = Storable::Create(theSObject, - theLocalPersistentID, - VISU_TMP_DIR, - theIsMultiFile); - if(aStorable != NULL) - aString = aStorable->GetID(); + Storable* aStorable = Storable::Create(theSObject, + theLocalPersistentID, + VISU_TMP_DIR, + theIsMultiFile); + if(aStorable != NULL) + aString = aStorable->GetID(); } return aString._retn(); } //---------------------------------------------------------------------------- - SALOMEDS::TMPFile* + SALOMEDS::TMPFile* VISU_Gen_i ::Save(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, - bool theIsMultiFile) + const char* theURL, + bool theIsMultiFile) { if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - theURL = '"<Value(); CORBA::Object_var anObj = SObjectToObject(aSObject); if(Result_i* aResult = dynamic_cast(GetServant(anObj).in())){ - aResult->Save(theComponent, - theURL, - theIsMultiFile, - false, - aFileNames, - aFiles); + aResult->Save(theComponent, + theURL, + theIsMultiFile, + false, + aFileNames, + aFiles); } } if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.size() - "<Value(); CORBA::Object_var anObj = SObjectToObject(aSObject); if(Result_i* aResult = dynamic_cast(GetServant(anObj).in())){ - aResult->Save(theComponent, - anURL, - theIsMultiFile, - true, - aFileNames, - aFiles); + aResult->Save(theComponent, + anURL, + theIsMultiFile, + true, + aFileNames, + aFiles); } } if(MYDEBUG) MESSAGE("VISU_Gen_i::SaveASCII - aFileNames.size() - "<string_to_object(theIORString); if(Storable* aStorable = dynamic_cast(GetServant(anObj).in())){ - aString = aStorable->ToString().c_str(); - return aString._retn(); + aString = aStorable->ToString().c_str(); + return aString._retn(); } } return aString._retn(); @@ -718,7 +717,7 @@ namespace VISU //---------------------------------------------------------------------------- - char* + char* VISU_Gen_i ::GetID() { @@ -735,37 +734,37 @@ namespace VISU std::string myStudyName; public: TEvent(const std::string theStudyName):myStudyName(theStudyName) - {} + {} virtual void Execute() - { - bool isActive = false; - SUIT_Session* aSession = SUIT_Session::session(); - QList anApplications = aSession->applications(); - QList::Iterator anIter = anApplications.begin(); - SUIT_Application* aFirstApp = *anIter; - while (anIter != anApplications.end()) { - SUIT_Application* anApp = *anIter; - if (SUIT_Study* aSStudy = anApp->activeStudy()) { - if (SalomeApp_Study* aStudy = dynamic_cast(aSStudy)) { + { + bool isActive = false; + SUIT_Session* aSession = SUIT_Session::session(); + QList anApplications = aSession->applications(); + QList::Iterator anIter = anApplications.begin(); + SUIT_Application* aFirstApp = *anIter; + while (anIter != anApplications.end()) { + SUIT_Application* anApp = *anIter; + if (SUIT_Study* aSStudy = anApp->activeStudy()) { + if (SalomeApp_Study* aStudy = dynamic_cast(aSStudy)) { if (_PTR(Study) aCStudy = aStudy->studyDS()) { - if(MYDEBUG) MESSAGE("There is an application with active study : StudyId = " - << aCStudy->StudyId() << "; Name = '" << aCStudy->Name() << "'"); - if (myStudyName == aCStudy->Name()) { - isActive = true; - break; - } - } - } - } - anIter++; - } - if (!isActive) { - MESSAGE("!!! anApp->onLoadDoc(myStudyName) !!!"); - // Has to be loaded in an empty or in a new application - SalomeApp_Application* anApp = dynamic_cast(aFirstApp); - anApp->onLoadDoc(myStudyName.c_str()); - } - } + if(MYDEBUG) MESSAGE("There is an application with active study : StudyId = " + << aCStudy->StudyId() << "; Name = '" << aCStudy->Name() << "'"); + if (myStudyName == aCStudy->Name()) { + isActive = true; + break; + } + } + } + } + anIter++; + } + if (!isActive) { + MESSAGE("!!! anApp->onLoadDoc(myStudyName) !!!"); + // Has to be loaded in an empty or in a new application + SalomeApp_Application* anApp = dynamic_cast(aFirstApp); + anApp->onLoadDoc(myStudyName.c_str()); + } + } }; if (!CORBA::is_nil(theStudy)) @@ -780,23 +779,23 @@ namespace VISU // Load MED component if necessary if(!myStudyDocument->FindComponent("MED")->_is_nil()) - { - SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService()); - Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","MED"); - SALOME_MED::MED_Gen_var aMedEngine = SALOME_MED::MED_Gen::_narrow(aComponent); - - if(!CORBA::is_nil(aMedEngine)) - { - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder(); - try { - aStudyBuilder->LoadWith( myStudyDocument->FindComponent( "MED" ), aMedEngine ); - } - catch( const SALOME::SALOME_Exception& ) { - // Oops, something went wrong while loading - // See also SalomeApp_Study::openDataModel() - } - } - } + { + SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService()); + Engines::EngineComponent_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","MED"); + SALOME_MED::MED_Gen_var aMedEngine = SALOME_MED::MED_Gen::_narrow(aComponent); + + if(!CORBA::is_nil(aMedEngine)) + { + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder(); + try { + aStudyBuilder->LoadWith( myStudyDocument->FindComponent( "MED" ), aMedEngine ); + } + catch( const SALOME::SALOME_Exception& ) { + // Oops, something went wrong while loading + // See also SalomeApp_Study::openDataModel() + } + } + } } else { INFOS("CORBA::is_nil(theStudy)"); } @@ -804,7 +803,7 @@ namespace VISU //---------------------------------------------------------------------------- - SALOMEDS::Study_ptr + SALOMEDS::Study_ptr VISU_Gen_i ::GetCurrentStudy() { @@ -813,7 +812,7 @@ namespace VISU //---------------------------------------------------------------------------- - ViewManager_ptr + ViewManager_ptr VISU_Gen_i ::GetViewManager() { @@ -824,7 +823,7 @@ namespace VISU //---------------------------------------------------------------------------- - SALOMEDS::SObject_ptr + SALOMEDS::SObject_ptr VISU_Gen_i ::ImportTables(const char* theFileName, bool theFirstStrAsTitle) { @@ -846,10 +845,10 @@ namespace VISU //---------------------------------------------------------------------------- - CORBA::Boolean + CORBA::Boolean VISU_Gen_i ::ExportTableToFile(SALOMEDS::SObject_ptr theTable, - const char* theFileName) + const char* theFileName) { return VISU::ExportTableToFile(theTable, theFileName); } @@ -864,12 +863,12 @@ namespace VISU return Result::_nil(); Result_i* aResult = Result_i::New(myStudyDocument, - Result_i::eFile, - Result_i::eImportFile, - true, - true, - true, - true); + Result_i::eFile, + Result_i::eImportFile, + true, + true, + true, + true); if(aResult->Create(theFileName) != NULL) return aResult->_this(); @@ -889,12 +888,12 @@ namespace VISU return Result::_nil(); Result_i* aResult = Result_i::New(myStudyDocument, - Result_i::eFile, - Result_i::eImportFile, - false, - true, - true, - true); + Result_i::eFile, + Result_i::eImportFile, + false, + true, + true, + true); if(aResult->Create(theFileName) != NULL) return aResult->_this(); @@ -914,12 +913,12 @@ namespace VISU return Result::_nil(); Result_i* aResult = Result_i::New(myStudyDocument, - Result_i::eRestoredFile, - Result_i::eCopyAndImportFile, - true, - true, - true, - true); + Result_i::eRestoredFile, + Result_i::eCopyAndImportFile, + true, + true, + true, + true); if(aResult->Create(theFileName) != NULL) return aResult->_this(); else @@ -936,19 +935,19 @@ namespace VISU return Result::_nil(); Result_i* aResult = Result_i::New(myStudyDocument, - Result_i::eComponent, - Result_i::eImportMed, - true, - true, - true, - true); + Result_i::eComponent, + Result_i::eImportMed, + true, + true, + true, + true); if (aResult->Create(theMedSObject) != NULL) { return aResult->_this(); } else aResult->_remove_ref(); - + return VISU::Result::_nil(); } @@ -962,35 +961,35 @@ namespace VISU return Result::_nil(); Result_i* aResult = Result_i::New(myStudyDocument, - Result_i::eComponent, - Result_i::eImportMedField, - true, - true, - true, - true); + Result_i::eComponent, + Result_i::eImportMedField, + true, + true, + true, + true); if (aResult->Create(theField) != NULL) return aResult->_this(); else aResult->_remove_ref(); - + return VISU::Result::_nil(); } void VISU_Gen_i ::RenameMeshInStudy(Result_ptr theResult, - const std::string& theMeshName, - int theEntity, // -1 for group indication - const std::string& theSubMeshName, // Family or Group name - const std::string& theNewName) + const std::string& theMeshName, + int theEntity, // -1 for group indication + const std::string& theSubMeshName, // Family or Group name + const std::string& theNewName) { Result_i* aResult = dynamic_cast(GetServant(theResult).in()); - if (!aResult) + if (!aResult) return; SALOMEDS::Study_var aStudyDocument = aResult->GetStudyDocument(); - if (aStudyDocument->GetProperties()->IsLocked()) + if (aStudyDocument->GetProperties()->IsLocked()) return; @@ -998,9 +997,9 @@ namespace VISU VISU::VISUType aType; if (theEntity >= 0) if (theSubMeshName == "") - aType = VISU::TENTITY; + aType = VISU::TENTITY; else - aType = VISU::TFAMILY; + aType = VISU::TFAMILY; else aType = VISU::TGROUP; @@ -1024,7 +1023,7 @@ namespace VISU } string anEntry = aResult->GetEntry(aRestoringMap); - if (anEntry == "") + if (anEntry == "") return; SALOMEDS::SObject_ptr aSObject = aStudyDocument->FindObjectID(anEntry.c_str()); @@ -1045,9 +1044,9 @@ namespace VISU void VISU_Gen_i ::RenameEntityInStudy(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theNewName) + const char* theMeshName, + VISU::Entity theEntity, + const char* theNewName) { RenameMeshInStudy(theResult, theMeshName, (int)theEntity, "", theNewName); } @@ -1057,22 +1056,22 @@ namespace VISU void VISU_Gen_i ::RenameFamilyInStudy(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFamilyName, - const char* theNewName) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFamilyName, + const char* theNewName) { RenameMeshInStudy(theResult, theMeshName, (int)theEntity, theFamilyName, theNewName); } //---------------------------------------------------------------------------- - void + void VISU_Gen_i ::RenameGroupInStudy(Result_ptr theResult, - const char* theMeshName, - const char* theGroupName, - const char* theNewName) + const char* theMeshName, + const char* theGroupName, + const char* theNewName) { RenameMeshInStudy(theResult, theMeshName, -1, theGroupName, theNewName); } @@ -1082,15 +1081,15 @@ namespace VISU Mesh_ptr VISU_Gen_i ::MeshOnEntity(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity) + const char* theMeshName, + VISU::Entity theEntity) { Result_i* aResult = dynamic_cast(GetServant(theResult).in()); - if (!aResult) + if (!aResult) return VISU::Mesh::_nil(); SALOMEDS::Study_var aStudyDocument = aResult->GetStudyDocument(); - if (aStudyDocument->GetProperties()->IsLocked()) + if (aStudyDocument->GetProperties()->IsLocked()) return VISU::Mesh::_nil(); Mesh_i* aPresent = new Mesh_i(); @@ -1104,19 +1103,19 @@ namespace VISU //---------------------------------------------------------------------------- - Mesh_ptr + Mesh_ptr VISU_Gen_i ::FamilyMeshOnEntity(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFamilyName) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFamilyName) { Result_i* aResult = dynamic_cast(GetServant(theResult).in()); - if (!aResult) + if (!aResult) return VISU::Mesh::_nil(); SALOMEDS::Study_var aStudyDocument = aResult->GetStudyDocument(); - if (aStudyDocument->GetProperties()->IsLocked()) + if (aStudyDocument->GetProperties()->IsLocked()) return VISU::Mesh::_nil(); Mesh_i* aPresent = new Mesh_i(); @@ -1133,15 +1132,15 @@ namespace VISU Mesh_ptr VISU_Gen_i ::GroupMesh(Result_ptr theResult, - const char* theMeshName, - const char* theGroupName) + const char* theMeshName, + const char* theGroupName) { Result_i* aResult = dynamic_cast(GetServant(theResult).in()); - if (!aResult) + if (!aResult) return VISU::Mesh::_nil(); SALOMEDS::Study_var aStudyDocument = aResult->GetStudyDocument(); - if (aStudyDocument->GetProperties()->IsLocked()) + if (aStudyDocument->GetProperties()->IsLocked()) return VISU::Mesh::_nil(); Mesh_i* aPresent = new Mesh_i(); @@ -1155,19 +1154,19 @@ namespace VISU //---------------------------------------------------------------------------- - ScalarMap_ptr + ScalarMap_ptr VISU_Gen_i ::ScalarMapOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return Prs3dOnField(theResult, - theMeshName, - theEntity, - theFieldName, - theIteration)._retn(); + theMeshName, + theEntity, + theFieldName, + theIteration)._retn(); } @@ -1175,135 +1174,135 @@ namespace VISU GaussPoints_ptr VISU_Gen_i ::GaussPointsOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return Prs3dOnField(theResult, - theMeshName, - theEntity, - theFieldName, - theIteration)._retn(); + theMeshName, + theEntity, + theFieldName, + theIteration)._retn(); } //--------------------------------------------------------------- - DeformedShape_ptr + DeformedShape_ptr VISU_Gen_i ::DeformedShapeOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return Prs3dOnField(theResult, - theMeshName, - theEntity, - theFieldName, - theIteration)._retn(); + theMeshName, + theEntity, + theFieldName, + theIteration)._retn(); } //--------------------------------------------------------------- - DeformedShapeAndScalarMap_ptr + DeformedShapeAndScalarMap_ptr VISU_Gen_i ::ScalarMapOnDeformedShapeOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return DeformedShapeAndScalarMapOnField(theResult, - theMeshName, - theEntity, - theFieldName, - theIteration); + theMeshName, + theEntity, + theFieldName, + theIteration); } - + //--------------------------------------------------------------- - DeformedShapeAndScalarMap_ptr + DeformedShapeAndScalarMap_ptr VISU_Gen_i ::DeformedShapeAndScalarMapOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return Prs3dOnField(theResult, - theMeshName, - theEntity, - theFieldName, - theIteration)._retn(); + theMeshName, + theEntity, + theFieldName, + theIteration)._retn(); } - + //--------------------------------------------------------------- - Vectors_ptr + Vectors_ptr VISU_Gen_i ::VectorsOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return Prs3dOnField(theResult, - theMeshName, - theEntity, - theFieldName, - theIteration)._retn(); + theMeshName, + theEntity, + theFieldName, + theIteration)._retn(); } //--------------------------------------------------------------- - IsoSurfaces_ptr + IsoSurfaces_ptr VISU_Gen_i ::IsoSurfacesOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return Prs3dOnField(theResult, - theMeshName, - theEntity, - theFieldName, - theIteration)._retn(); + theMeshName, + theEntity, + theFieldName, + theIteration)._retn(); } //--------------------------------------------------------------- - StreamLines_ptr + StreamLines_ptr VISU_Gen_i ::StreamLinesOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return Prs3dOnField(theResult, - theMeshName, - theEntity, - theFieldName, - theIteration)._retn(); + theMeshName, + theEntity, + theFieldName, + theIteration)._retn(); } //--------------------------------------------------------------- - Plot3D_ptr + Plot3D_ptr VISU_Gen_i ::Plot3DOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return Prs3dOnField(theResult, - theMeshName, - theEntity, - theFieldName, - theIteration)._retn(); + theMeshName, + theEntity, + theFieldName, + theIteration)._retn(); } @@ -1311,16 +1310,16 @@ namespace VISU CutPlanes_ptr VISU_Gen_i ::CutPlanesOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return Prs3dOnField(theResult, - theMeshName, - theEntity, - theFieldName, - theIteration)._retn(); + theMeshName, + theEntity, + theFieldName, + theIteration)._retn(); } @@ -1328,32 +1327,32 @@ namespace VISU CutLines_ptr VISU_Gen_i ::CutLinesOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return Prs3dOnField(theResult, - theMeshName, - theEntity, - theFieldName, - theIteration)._retn(); + theMeshName, + theEntity, + theFieldName, + theIteration)._retn(); } //--------------------------------------------------------------- CutSegment_ptr VISU_Gen_i ::CutSegmentOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - CORBA::Long theIteration) + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Long theIteration) { return Prs3dOnField(theResult, - theMeshName, - theEntity, - theFieldName, - theIteration)._retn(); + theMeshName, + theEntity, + theFieldName, + theIteration)._retn(); } //--------------------------------------------------------------- @@ -1363,14 +1362,14 @@ namespace VISU const char* myTableEntry; typedef Table_ptr TResult; TResult myResult; - + CreateTableEvent(SALOMEDS::Study_var theStudy, const char* theTableEntry) { myStudyDocument = theStudy; myTableEntry = theTableEntry; myResult = Table::_nil(); } - + virtual void Execute() @@ -1378,24 +1377,24 @@ namespace VISU SALOMEDS::SObject_var SO = myStudyDocument->FindObjectID(myTableEntry); SALOMEDS::GenericAttribute_var anAttr; if ( SO->FindAttribute(anAttr, "AttributeTableOfReal") ) { - SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr); - if ( isSparseMatrix( aTableOfReal ) ) { - PointMap3d_i* pPresent = new PointMap3d_i(myStudyDocument,myTableEntry); - if(pPresent->Create() != NULL) - myResult = pPresent->_this(); - else { - pPresent->_remove_ref(); - myResult = VISU::Table::_nil(); - } - return; - } + SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr); + if ( isSparseMatrix( aTableOfReal ) ) { + PointMap3d_i* pPresent = new PointMap3d_i(myStudyDocument,myTableEntry); + if(pPresent->Create() != NULL) + myResult = pPresent->_this(); + else { + pPresent->_remove_ref(); + myResult = VISU::Table::_nil(); + } + return; + } } Table_i* pPresent = new Table_i(myStudyDocument,myTableEntry); if(pPresent->Create() != NULL) - myResult = pPresent->_this(); + myResult = pPresent->_this(); else { - pPresent->_remove_ref(); - myResult = VISU::Table::_nil(); + pPresent->_remove_ref(); + myResult = VISU::Table::_nil(); } } @@ -1405,12 +1404,12 @@ namespace VISU { int aCols = theTableOfReal->GetNbColumns(); int aRows = theTableOfReal->GetNbRows(); - + for (int i=1; i<=aCols; i++) { - for (int j=1; j<=aRows; j++) { - if ( !(theTableOfReal->HasValue(j, i)) ) - return false; - } + for (int j=1; j<=aRows; j++) { + if ( !(theTableOfReal->HasValue(j, i)) ) + return false; + } } return true; } @@ -1423,7 +1422,7 @@ namespace VISU { TCollection_AsciiString tmp( (char*)theTableEntry ); // 11.06.2008 IPAL18844 if( myStudyDocument->GetProperties()->IsLocked() || - tmp.Length()==0 ) + tmp.Length()==0 ) return Table::_nil(); return ProcessEvent(new CreateTableEvent(myStudyDocument, theTableEntry)); @@ -1433,8 +1432,8 @@ namespace VISU Curve_ptr VISU_Gen_i ::CreateCurve(Table_ptr theTable, - CORBA::Long theHRow, - CORBA::Long theVRow) + CORBA::Long theHRow, + CORBA::Long theVRow) { return CreateCurveWithZExt( theTable, theHRow, theVRow, 0, false ); } @@ -1444,9 +1443,9 @@ namespace VISU Curve_ptr VISU_Gen_i ::CreateCurveWithZ(Table_ptr theTable, - CORBA::Long theHRow, - CORBA::Long theVRow, - CORBA::Long theZRow) + CORBA::Long theHRow, + CORBA::Long theVRow, + CORBA::Long theZRow) { return CreateCurveWithZExt( theTable, theHRow, theVRow, theZRow, false ); } @@ -1547,14 +1546,14 @@ namespace VISU VISU_Gen_i ::Close(SALOMEDS::SComponent_ptr theComponent) { - if ( !CORBA::is_nil( myStudyDocument ) && !CORBA::is_nil( theComponent ) && - myStudyDocument->StudyId() == theComponent->GetStudy()->StudyId()) + if ( !CORBA::is_nil( myStudyDocument ) && !CORBA::is_nil( theComponent ) && + myStudyDocument->StudyId() == theComponent->GetStudy()->StudyId()) myStudyDocument = SALOMEDS::Study::_nil(); } //--------------------------------------------------------------- - char* + char* VISU_Gen_i ::ComponentDataType() { @@ -1565,7 +1564,7 @@ namespace VISU //--------------------------------------------------------------- bool VISU_Gen_i - ::CanPublishInStudy(CORBA::Object_ptr theIOR) + ::CanPublishInStudy(CORBA::Object_ptr theIOR) { Result_var aResultObj = Result::_narrow(theIOR); return !(aResultObj->_is_nil()); @@ -1576,9 +1575,9 @@ namespace VISU SALOMEDS::SObject_ptr VISU_Gen_i ::PublishInStudy(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject, - CORBA::Object_ptr theObject, - const char* theName) + SALOMEDS::SObject_ptr theSObject, + CORBA::Object_ptr theObject, + const char* theName) throw (SALOME::SALOME_Exception) { Unexpect aCatch(SalomeException); @@ -1586,7 +1585,7 @@ namespace VISU Mutex mt(myMutex); SALOMEDS::SObject_var aResultSO; Result_i* aResultObj = dynamic_cast(GetServant(theObject).in()); - if (!aResultObj) + if (!aResultObj) return aResultSO._retn(); const QFileInfo& aFileInfo = aResultObj->GetFileInfo(); CORBA::String_var anEntry = aResultObj->Create((const char*)aFileInfo.absoluteFilePath().toLatin1())->GetID(); @@ -1596,9 +1595,9 @@ namespace VISU //--------------------------------------------------------------- - CORBA::Boolean + CORBA::Boolean VISU_Gen_i - ::CanCopy(SALOMEDS::SObject_ptr theObject) + ::CanCopy(SALOMEDS::SObject_ptr theObject) { CORBA::Object_var anObj = SObjectToObject(theObject); if (Storable* aStorable = dynamic_cast(GetServant(anObj).in())) @@ -1609,10 +1608,10 @@ namespace VISU //--------------------------------------------------------------- - SALOMEDS::TMPFile* + SALOMEDS::TMPFile* VISU_Gen_i - ::CopyFrom(SALOMEDS::SObject_ptr theObject, - CORBA::Long& theObjectID) + ::CopyFrom(SALOMEDS::SObject_ptr theObject, + CORBA::Long& theObjectID) { theObjectID = 0; SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile; @@ -1629,10 +1628,10 @@ namespace VISU SALOMEDS::ListOfFileNames_var aListOfFileNames = new SALOMEDS::ListOfFileNames; aListOfFileNames->length(aFileNames.size()); for(size_t anId = 0; anId < aFileNames.size(); anId++) - aListOfFileNames[anId] = aFileNames[anId].c_str(); + aListOfFileNames[anId] = aFileNames[anId].c_str(); if(anIsDone) - aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aListOfFileNames.in(), false); + aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aListOfFileNames.in(), false); SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aListOfFileNames.in(), true); } @@ -1641,7 +1640,7 @@ namespace VISU //--------------------------------------------------------------- - CORBA::Boolean + CORBA::Boolean VISU_Gen_i ::CanPaste(const char* theComponentName, CORBA::Long theObjectID) { // The VISU component can paste only objects copied by VISU component @@ -1656,8 +1655,8 @@ namespace VISU SALOMEDS::SObject_ptr VISU_Gen_i ::PasteInto(const SALOMEDS::TMPFile& theStream, - CORBA::Long theObjectID, - SALOMEDS::SObject_ptr theSObject) + CORBA::Long theObjectID, + SALOMEDS::SObject_ptr theSObject) { if (theObjectID != 1) return SALOMEDS::SObject::_nil(); @@ -1667,43 +1666,43 @@ namespace VISU SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); CORBA::String_var aComponentID(aComponent->GetID()); CORBA::String_var aSObjectID(theSObject->GetID()); - + SALOMEDS::SObject_var aSObject; if (strcmp(aComponentID, aSObjectID) == 0) //create the new result SObject aSObject = aStudyBuilder->NewObject(aComponent); else aSObject = SALOMEDS::SObject::_duplicate(theSObject); - + std::string aTmpDir = SALOMEDS_Tool::GetTmpDir(); - SALOMEDS::ListOfFileNames_var aListOfFileNames = + SALOMEDS::ListOfFileNames_var aListOfFileNames = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir, false); if(MYDEBUG) MESSAGE("Result_i::PasteInto - aListOfFileNames->length() = "<length()); - + std::ostringstream aLocalPersistentID; { std::string aCopyPersist = aTmpDir + "copy_persistent"; std::ifstream anInputFileStream( aCopyPersist.c_str() ); anInputFileStream >> aLocalPersistentID.rdbuf(); } - + //Just for Result::Restore to find the Comment attribute :( SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString"); - + std::string aFileName(aTmpDir); if(aListOfFileNames->length() > 1) aFileName += aListOfFileNames[1].in(); Storable* aStorable = Storable::Create(aSObject, aLocalPersistentID.str(), aFileName, false); - + SALOMEDS::ListOfFileNames_var aFilesToRemove = new SALOMEDS::ListOfFileNames; aFilesToRemove->length(1); aFilesToRemove[0] = aListOfFileNames[0]; SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aFilesToRemove.in(), true); - + anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeIOR"); SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); CORBA::String_var anIORValue(aStorable->GetID()); anIOR->SetValue(anIORValue); - + return aSObject._retn(); } @@ -1716,27 +1715,27 @@ namespace VISU return ColoredPrs3dCache_i::GetInstance(theStudy); } - - CORBA::Long VISU_Gen_i::CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z, - CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ, - CORBA::Boolean isAuto, const char* name) + + CORBA::Long VISU_Gen_i::CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z, + CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ, + CORBA::Boolean isAuto, const char* name) { return myClippingPlaneMgr.CreateClippingPlane(X, Y, Z, dX, dY, dZ, isAuto, name); } - - void VISU_Gen_i::EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z, - CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ, - CORBA::Boolean isAuto, const char* name) + + void VISU_Gen_i::EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z, + CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ, + CORBA::Boolean isAuto, const char* name) { myClippingPlaneMgr.EditClippingPlane(id, X, Y, Z, dX, dY, dZ, isAuto, name); } - + /* Returns clipping plane by its Id */ VISU::ClippingPlane* VISU_Gen_i::GetClippingPlane(CORBA::Long id) { VISU_CutPlaneFunction* aPlane = myClippingPlaneMgr.GetClippingPlane(id); - + if (aPlane != NULL) { double aOrigin[3]; double aDir[3]; @@ -1757,13 +1756,13 @@ namespace VISU } return NULL; } - + /* Deletes clipping plane by its Id */ CORBA::Boolean VISU_Gen_i::DeleteClippingPlane(CORBA::Long id) { return myClippingPlaneMgr.DeleteClippingPlane(id); } - + /* Applyes a clipping plane with Id to presentation thePrs */ CORBA::Boolean VISU_Gen_i::ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id) { @@ -1777,7 +1776,7 @@ namespace VISU VISU::Prs3d_i* aPrs = dynamic_cast(VISU::GetServant(thePrs).in()); return myClippingPlaneMgr.DetachClippingPlane(aPrs, id); } - + /* Get number of clipping planes */ CORBA::Long VISU_Gen_i::GetClippingPlanesNb() { @@ -1797,9 +1796,9 @@ namespace VISU CORBA::Boolean VISU_Gen_i ::VTK2MED( const VISU::string_array& theVTKFiles, - const char* theMEDFile, - const char* theMeshName, - const VISU::double_array& theTStamps ) + const char* theMEDFile, + const char* theMeshName, + const VISU::double_array& theTStamps ) { if ( !theMEDFile || !theVTKFiles.length() ) return false; diff --git a/src/VISU_I/VISU_Result_i.cc b/src/VISU_I/VISU_Result_i.cc index 09c78b18..2e80e13a 100644 --- a/src/VISU_I/VISU_Result_i.cc +++ b/src/VISU_I/VISU_Result_i.cc @@ -18,13 +18,12 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // VISU OBJECT : interactive object for VISU entities implementation // File : VISU_Result_i.cc // Author : Alexey PETROV // Module : VISU -// + #include "VISU_MultiResult_i.hh" #include "VISU_ResultUtils.hh" #include "VISU_Prs3d_i.hh" @@ -76,7 +75,7 @@ using namespace std; namespace VISU { //--------------------------------------------------------------- - Result_var + Result_var FindResult(SALOMEDS::SObject_ptr theSObject) { SALOMEDS::SComponent_var aSComponent = theSObject->GetFatherComponent(); @@ -87,8 +86,8 @@ namespace VISU while (strcmp(aComponentID, aFatherID) != 0) { CORBA::Object_var anObject = SObjectToObject(aFather); if (!CORBA::is_nil(anObject)) { - aResult = Result::_narrow(anObject); - if (!aResult->_is_nil()) return aResult; + aResult = Result::_narrow(anObject); + if (!aResult->_is_nil()) return aResult; } aFather = aFather->GetFather(); aFatherID = aFather->GetID(); @@ -98,20 +97,20 @@ namespace VISU //--------------------------------------------------------------- - Result_i* + Result_i* GetResult(SALOMEDS::Study_ptr theStudy, - const std::string& theResultEntry) + const std::string& theResultEntry) { Result_i* result = NULL; if (!CORBA::is_nil(theStudy)) { SALOMEDS::SComponent_var aSComponent = theStudy->FindComponent("VISU"); if (!CORBA::is_nil(aSComponent)) { - std::string compid = aSComponent->GetID(); - std::string aResultEntry = theResultEntry; - if (theResultEntry.substr(0, compid.length()) != compid) aResultEntry = compid + theResultEntry.substr(compid.length()); - SALOMEDS::SObject_var aSObject = theStudy->FindObjectID(aResultEntry.c_str()); - CORBA::Object_var anObject = SObjectToObject(aSObject); - result = dynamic_cast(GetServant(anObject).in()); + std::string compid = aSComponent->GetID(); + std::string aResultEntry = theResultEntry; + if (theResultEntry.substr(0, compid.length()) != compid) aResultEntry = compid + theResultEntry.substr(compid.length()); + SALOMEDS::SObject_var aSObject = theStudy->FindObjectID(aResultEntry.c_str()); + CORBA::Object_var anObject = SObjectToObject(aSObject); + result = dynamic_cast(GetServant(anObject).in()); } } return result; @@ -131,8 +130,8 @@ namespace VISU //--------------------------------------------------------------- void CreateReference (SALOMEDS::Study_ptr theStudyDocument, - const string& theFatherEntry, - const string& theRefEntry) + const string& theFatherEntry, + const string& theRefEntry) { SALOMEDS::StudyBuilder_var aStudyBuilder = theStudyDocument->NewBuilder(); SALOMEDS::SObject_var aFather = theStudyDocument->FindObjectID(theFatherEntry.c_str()); @@ -153,12 +152,12 @@ const char* VISU::Result_i::GetComment() const { return myComment.c_str();} //--------------------------------------------------------------- VISU::Result_i ::Result_i(SALOMEDS::Study_ptr theStudy, - const ESourceId& theSourceId, - const ECreationId& theCreationId, - CORBA::Boolean theIsBuildImmediately, - CORBA::Boolean theIsBuildFields, - CORBA::Boolean theIsBuildMinMax, - CORBA::Boolean theIsBuildGroups): + const ESourceId& theSourceId, + const ECreationId& theCreationId, + CORBA::Boolean theIsBuildImmediately, + CORBA::Boolean theIsBuildFields, + CORBA::Boolean theIsBuildMinMax, + CORBA::Boolean theIsBuildGroups): myStudyDocument(SALOMEDS::Study::_duplicate(theStudy)), myCreationId(theCreationId), mySourceId(theSourceId), @@ -199,7 +198,7 @@ VISU::Result_i ::~Result_i() { MESSAGE("Result_i::~Result_i() - this = "<myGroupMap; - VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin(); - for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){ - const string& aGroupName = aGroupMapIter->first; - try{ - myInput->GetMeshOnGroup(aMeshName,aGroupName); - }catch(std::exception& exc){ - INFOS("Follow exception was occured :\n"<myFamilyMap; - VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin(); - for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){ - const string& aFamilyName = aFamilyMapIter->first; - try{ - myInput->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName); - }catch(std::exception& exc){ - INFOS("Follow exception was occured :\n"<GetMeshOnEntity(aMeshName,anEntity); - }catch(std::exception& exc){ - INFOS("Follow exception was occured :\n"<first; + const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second; + const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; + VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin(); + for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){ + const string& aFieldName = aFieldMapIter->first; + const VISU::PField aField = aFieldMapIter->second; + const VISU::TValField& aValField = aField->myValField; + VISU::TValField::const_iterator aValFieldIter = aValField.begin(); + for(; aValFieldIter != aValField.end(); aValFieldIter++){ + int aTimeStamp = aValFieldIter->first; + try{ + myInput->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp); + }catch(std::exception& exc){ + INFOS("Follow exception was occured :\n"<myGroupMap; + VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin(); + for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){ + const string& aGroupName = aGroupMapIter->first; + try{ + myInput->GetMeshOnGroup(aMeshName,aGroupName); + }catch(std::exception& exc){ + INFOS("Follow exception was occured :\n"<myFamilyMap; + VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin(); + for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){ + const string& aFamilyName = aFamilyMapIter->first; + try{ + myInput->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName); + }catch(std::exception& exc){ + INFOS("Follow exception was occured :\n"<GetMeshOnEntity(aMeshName,anEntity); + }catch(std::exception& exc){ + INFOS("Follow exception was occured :\n"<NewBuilder(); SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::AttributePixMap_var aPixmap; SALOMEDS::AttributeUserID_var aId; - + anAttr = aStudyBuilder->FindOrCreateAttribute( mySObject, "AttributePixMap" ); aPixmap = SALOMEDS::AttributePixMap::_narrow( anAttr ); aPixmap ->SetPixMap("ICON_TREE_RESULT"); @@ -405,19 +404,19 @@ VISU::Result_i anAttr = aStudyBuilder->FindOrCreateAttribute( mySObject, auid.c_str() ); aId = SALOMEDS::AttributeUserID::_narrow( anAttr ); aId ->SetValue("VISU.RESULT"); - + if(theIsBuildAll) return BuildAll(); return true; } - + return false; } //--------------------------------------------------------------- VISU::Storable* VISU::Result_i::Build(SALOMEDS::SObject_ptr theSObject, - CORBA::Boolean theIsAtOnce) + CORBA::Boolean theIsAtOnce) { if(!myInput) return NULL; @@ -430,18 +429,18 @@ VISU::Storable* VISU::Result_i::Build(SALOMEDS::SObject_ptr theSObject, CORBA::String_var anIOR(GetID()); QString aComment; aComment.sprintf("myComment=%s;myFileName=%s;myInitFileName=%s", - GetComment(), - myFileInfo.filePath().toLatin1().data(), - GetInitFileName().c_str()); // Restoring of Python dump - std::string aResultEntry = + GetComment(), + myFileInfo.filePath().toLatin1().data(), + GetInitFileName().c_str()); // Restoring of Python dump + std::string aResultEntry = CreateAttributes(myStudy, - aSComponentEntry.in(), - NO_ICON, - anIOR.in(), - GetName(), - NO_PERFSITENT_REF, - aComment.toLatin1().data(), - true); + aSComponentEntry.in(), + NO_ICON, + anIOR.in(), + GetName(), + NO_PERFSITENT_REF, + aComment.toLatin1().data(), + true); mySObject = myStudyDocument->FindObjectID(aResultEntry.c_str()); if(!CORBA::is_nil(theSObject)){ CORBA::String_var aString = theSObject->GetID(); @@ -450,32 +449,32 @@ VISU::Storable* VISU::Result_i::Build(SALOMEDS::SObject_ptr theSObject, if(theIsAtOnce){ BuildEntities(this, - myInput, - &myIsEntitiesDone, - aResultEntry, - theIsAtOnce, - myIsBuildGroups, - myIsBuildFields, - myIsBuildParts, - myStudy); - + myInput, + &myIsEntitiesDone, + aResultEntry, + theIsAtOnce, + myIsBuildGroups, + myIsBuildFields, + myIsBuildParts, + myStudy); + BuildGroups(this, - myInput, - &myIsGroupsDone, - myIsBuildGroups, - theIsAtOnce, - myStudy); + myInput, + &myIsGroupsDone, + myIsBuildGroups, + theIsAtOnce, + myStudy); BuildFieldDataTree(this, - myInput, - &myIsFieldsDone, - myIsBuildFields, - &myIsMinMaxDone, - myIsBuildMinMax, - myStudy); + myInput, + &myIsFieldsDone, + myIsBuildFields, + &myIsMinMaxDone, + myIsBuildMinMax, + myStudy); } else { boost::thread aThread(boost::bind(boost::bind(&Result_i::BuildDataTree, this, _1), - aResultEntry)); + aResultEntry)); } return this; @@ -488,33 +487,33 @@ VISU::Result_i ::BuildDataTree(const std::string& theResultEntry) { BuildEntities(this, - myInput, - &myIsEntitiesDone, - theResultEntry, - false, - myIsBuildGroups, - myIsBuildFields, - myIsBuildParts, - myStudy); + myInput, + &myIsEntitiesDone, + theResultEntry, + false, + myIsBuildGroups, + myIsBuildFields, + myIsBuildParts, + myStudy); { boost::thread aThread(boost::bind(&BuildGroups, - this, - myInput, - &myIsGroupsDone, - myIsBuildGroups, - false, - myStudy)); + this, + myInput, + &myIsGroupsDone, + myIsBuildGroups, + false, + myStudy)); } { boost::thread aThread(boost::bind(&BuildFieldDataTree, - this, - myInput, - &myIsFieldsDone, - myIsBuildFields, - &myIsMinMaxDone, - myIsBuildMinMax, - myStudy)); + this, + myInput, + &myIsFieldsDone, + myIsBuildFields, + &myIsMinMaxDone, + myIsBuildMinMax, + myStudy)); } } @@ -543,7 +542,7 @@ VISU::Result_i VISU::Storable* VISU::Result_i ::Create(const char* theFileName) -{ +{ try { myFileInfo.setFile(theFileName); myFileName = myFileInfo.fileName().toLatin1().data(); @@ -558,7 +557,7 @@ VISU::Result_i std::string aFileName = VISU::MakeFileName(myFileInfo.fileName().toLatin1().data(), this); QString aPathToCopy(aTmpDir + aFileName.c_str()); if(!VISU::CopyFile(myFileInfo.absoluteFilePath().toLatin1().data(), aPathToCopy.toLatin1().data())) - return NULL; + return NULL; myFileInfo.setFile(aPathToCopy); myFileName = myFileInfo.fileName().toLatin1().data(); @@ -568,7 +567,7 @@ VISU::Result_i if(myInput){ if(myIsBuildImmediately) - Build(SALOMEDS::SObject::_nil()); + Build(SALOMEDS::SObject::_nil()); return this; } }catch(std::exception& exc){ @@ -674,12 +673,12 @@ VISU::Result_i if(theIsMultiFile || theIsASCII){ std::string aPathToCopy(theURL + aFileName); BEGMSG(MYDEBUG, "aPathToCopy = '"<(aPathToCopy.c_str()), true); + HDFascii::ConvertFromHDFToASCII(const_cast(aPathToCopy.c_str()), true); } theFileNames.push_back(aFileName); @@ -693,16 +692,16 @@ VISU::Result_i //--------------------------------------------------------------- -CORBA::Boolean +CORBA::Boolean VISU::Result_i -::CanCopy(SALOMEDS::SObject_ptr theObject) +::CanCopy(SALOMEDS::SObject_ptr theObject) { switch(GetCreationId()){ case Result_i::eImportFile: - case Result_i::eCopyAndImportFile: + case Result_i::eCopyAndImportFile: return true; } - + return false; } @@ -710,14 +709,14 @@ VISU::Result_i //--------------------------------------------------------------- bool VISU::Result_i -::CopyFrom(SALOMEDS::SObject_ptr theObject, - CORBA::Long& theObjectID, - const std::string& theTmpDir, - TFileNames& theFileNames) +::CopyFrom(SALOMEDS::SObject_ptr theObject, + CORBA::Long& theObjectID, + const std::string& theTmpDir, + TFileNames& theFileNames) { if(!Storable::CopyFrom(theObject, theObjectID, theTmpDir, theFileNames)) return false; - + SALOMEDS::Study_var aStudy = theObject->GetStudy(); CORBA::String_var anURL = aStudy->URL(); std::string aPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in()); @@ -746,9 +745,9 @@ VISU::Result_i VISU::Storable* VISU::Result_i ::Restore(SALOMEDS::SObject_ptr theSObject, - const Storable::TRestoringMap& theMap, - const string& thePrefix, - CORBA::Boolean theIsMultiFile) + const Storable::TRestoringMap& theMap, + const string& thePrefix, + CORBA::Boolean theIsMultiFile) { if(MYDEBUG) MESSAGE("Result_i::Restore - " << thePrefix); mySObject = SALOMEDS::SObject::_duplicate(theSObject); @@ -773,11 +772,11 @@ VISU::Result_i for (int i = 0; i < myFileName.length(); i++) { if (myFileName[i] == ':') - myFileName[i] = '_'; + myFileName[i] = '_'; } #endif SetInitFileName(VISU::Storable::FindValue(theMap, "myInitFileName").toLatin1().data()); - + SALOMEDS::SObject_var aRefSObj, aTargetRefSObj; if (theSObject->FindSubObject(1, aRefSObj) && aRefSObj->ReferencedObject(aTargetRefSObj)) { if(MYDEBUG) MESSAGE("Result_i::GetInput - There is some reference."); @@ -785,10 +784,10 @@ VISU::Result_i CORBA::String_var aDataType = aCompRefSObj->ComponentDataType(); myFileInfo.setFile(aDataType.in()); if(MYDEBUG) MESSAGE("Result_i::GetInput - aDataType = " << aDataType); - Engines::Component_var aEngComp = - Base_i::myEnginesLifeCycle->FindOrLoad_Component("FactoryServer", aDataType.in()); + Engines::EngineComponent_var aEngComp = + Base_i::myEnginesLifeCycle->FindOrLoad_Component("FactoryServer", aDataType.in()); if (CORBA::is_nil(aEngComp)) - throw std::runtime_error("Restore - There is no aEngComp for the aDataType !!!"); + throw std::runtime_error("Restore - There is no aEngComp for the aDataType !!!"); SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder(); SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(aEngComp); aStudyBuilder->LoadWith(aCompRefSObj, aDriver); @@ -797,100 +796,100 @@ VISU::Result_i SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(aMedObject); if (!CORBA::is_nil(aField)) { // create field converter - myInput.reset(CreateMEDFieldConvertor(aField)); - myInput->Build(); + myInput.reset(CreateMEDFieldConvertor(aField)); + myInput->Build(); } else if (strcmp(aDataType, "MED") == 0) { // create MED converter - myInput.reset(CreateMEDConvertor(aTargetRefSObj)); - myInput->Build(); + myInput.reset(CreateMEDConvertor(aTargetRefSObj)); + myInput->Build(); } else { - throw std::runtime_error("GetInput - There is no convertor for the aDataType !!!"); + throw std::runtime_error("GetInput - There is no convertor for the aDataType !!!"); } } else { myFileInfo.setFile(thePrefix.c_str()); std::string aStudyPrefix (""); if (theIsMultiFile) { - CORBA::String_var anURL(GetStudyDocument()->URL()); - aStudyPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in()); + CORBA::String_var anURL(GetStudyDocument()->URL()); + aStudyPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in()); } if (!myFileInfo.isFile()) { - std::string aFileName = thePrefix + aStudyPrefix + "_" + myFileName; - myFileInfo.setFile(aFileName.c_str()); + std::string aFileName = thePrefix + aStudyPrefix + "_" + myFileName; + myFileInfo.setFile(aFileName.c_str()); } if(MYDEBUG) - MESSAGE("Result_i::Restore - aFileName = " << myFileInfo.filePath().toLatin1().data() << "; " << myFileInfo.isFile()); - + MESSAGE("Result_i::Restore - aFileName = " << myFileInfo.filePath().toLatin1().data() << "; " << myFileInfo.isFile()); + if (HDFascii::isASCII(myFileInfo.filePath().toLatin1().data())) { - MESSAGE("ConvertFromASCIIToHDF(" << myFileInfo.filePath().toLatin1().data() << ")"); - char* aResultPath = HDFascii::ConvertFromASCIIToHDF(myFileInfo.filePath().toLatin1().data()); - MESSAGE("ConvertFromASCIIToHDF() DONE : " << aResultPath); - char* aHDFFileName = new char[strlen(aResultPath) + 19]; - sprintf(aHDFFileName, "%shdf_from_ascii.hdf", aResultPath); - - if (theIsMultiFile) { // set this file as new - temporary - static QString aCommand; - aCommand.sprintf(" %s %s%s",aHDFFileName, aResultPath, myFileInfo.baseName().toLatin1().data()); - aCommand = QDir::convertSeparators( aCommand ); - aCommand.prepend( MOVE_COMMAND ); - - if (system(aCommand.toLatin1().data()) == -1) { - if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - Can't execute the command :" << aCommand.toLatin1().data()); - return NULL; - } else { - if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - " << aCommand.toLatin1().data()); - } - myFileInfo.setFile(QString(aResultPath) + myFileInfo.baseName()); - } else { // change current temporary file to the new: with hdf-format - static QString aCommand; - aCommand.sprintf(" %s %s\0",aHDFFileName, myFileInfo.filePath().toLatin1().data()); - aCommand = QDir::convertSeparators( aCommand ); - aCommand.prepend( MOVE_COMMAND ); - - if (system(aCommand.toLatin1().data()) == -1) { - if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - Can't execute the command :" << aCommand.toLatin1().data()); - return NULL; - } else { - if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - " << aCommand.toLatin1().data()); - } - SALOMEDS::ListOfFileNames_var anEmptyList = new SALOMEDS::ListOfFileNames; - SALOMEDS_Tool::RemoveTemporaryFiles(aResultPath, anEmptyList.in(), true); - } - mySourceId = eRestoredFile; - delete(aResultPath); - delete(aHDFFileName); + MESSAGE("ConvertFromASCIIToHDF(" << myFileInfo.filePath().toLatin1().data() << ")"); + char* aResultPath = HDFascii::ConvertFromASCIIToHDF(myFileInfo.filePath().toLatin1().data()); + MESSAGE("ConvertFromASCIIToHDF() DONE : " << aResultPath); + char* aHDFFileName = new char[strlen(aResultPath) + 19]; + sprintf(aHDFFileName, "%shdf_from_ascii.hdf", aResultPath); + + if (theIsMultiFile) { // set this file as new - temporary + static QString aCommand; + aCommand.sprintf(" %s %s%s",aHDFFileName, aResultPath, myFileInfo.baseName().toLatin1().data()); + aCommand = QDir::convertSeparators( aCommand ); + aCommand.prepend( MOVE_COMMAND ); + + if (system(aCommand.toLatin1().data()) == -1) { + if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - Can't execute the command :" << aCommand.toLatin1().data()); + return NULL; + } else { + if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - " << aCommand.toLatin1().data()); + } + myFileInfo.setFile(QString(aResultPath) + myFileInfo.baseName()); + } else { // change current temporary file to the new: with hdf-format + static QString aCommand; + aCommand.sprintf(" %s %s\0",aHDFFileName, myFileInfo.filePath().toLatin1().data()); + aCommand = QDir::convertSeparators( aCommand ); + aCommand.prepend( MOVE_COMMAND ); + + if (system(aCommand.toLatin1().data()) == -1) { + if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - Can't execute the command :" << aCommand.toLatin1().data()); + return NULL; + } else { + if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - " << aCommand.toLatin1().data()); + } + SALOMEDS::ListOfFileNames_var anEmptyList = new SALOMEDS::ListOfFileNames; + SALOMEDS_Tool::RemoveTemporaryFiles(aResultPath, anEmptyList.in(), true); + } + mySourceId = eRestoredFile; + delete(aResultPath); + delete(aHDFFileName); } else if (!theIsMultiFile) { - mySourceId = eRestoredFile; + mySourceId = eRestoredFile; } else { - mySourceId = eSavedFile; + mySourceId = eSavedFile; } if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - mySourceId = " << mySourceId); myInput.reset(CreateConvertor(myFileInfo.filePath().toLatin1().data())); myInput->BuildEntities(); if(myIsBuildFields){ - myInput->BuildFields(); - myIsFieldsDone = true; - if(myIsBuildMinMax){ - myInput->BuildMinMax(); - myIsMinMaxDone = true; - } + myInput->BuildFields(); + myIsFieldsDone = true; + if(myIsBuildMinMax){ + myInput->BuildMinMax(); + myIsMinMaxDone = true; + } } if(myIsBuildGroups){ - myInput->BuildGroups(); - myIsGroupsDone = true; + myInput->BuildGroups(); + myIsGroupsDone = true; } QString aComment; aComment.sprintf("myComment=%s;myFileName=%s;myInitFileName=%s", - GetComment(), - myFileInfo.filePath().toLatin1().data(), - GetInitFileName().c_str()); // Restoring of Python dump + GetComment(), + myFileInfo.filePath().toLatin1().data(), + GetInitFileName().c_str()); // Restoring of Python dump SALOMEDS::GenericAttribute_var anAttr; if (!theSObject->FindAttribute(anAttr, "AttributeString")) - throw std::runtime_error("Build - There is no AttributeString for the SObject !!!"); + throw std::runtime_error("Build - There is no AttributeString for the SObject !!!"); SALOMEDS::AttributeString_var aCmnt = SALOMEDS::AttributeString::_narrow(anAttr); aCmnt->SetValue(aComment.toLatin1().data()); } @@ -910,38 +909,38 @@ VISU::Result_i //--------------------------------------------------------------- VISU::Result_i::PInput VISU::Result_i -::GetInput(const std::string& theMeshName, - VISU::Entity theEntity, - const std::string& theFieldName, - CORBA::Long theTimeStampNumber) +::GetInput(const std::string& theMeshName, + VISU::Entity theEntity, + const std::string& theFieldName, + CORBA::Long theTimeStampNumber) { return myInput; } //--------------------------------------------------------------- -CORBA::Boolean +CORBA::Boolean VISU::Result_i -::IsDone() +::IsDone() { - return - myIsEntitiesDone && + return + myIsEntitiesDone && (myIsBuildFields? myIsFieldsDone: true) && (myIsBuildMinMax? myIsMinMaxDone: true) && (myIsBuildGroups? myIsGroupsDone: true); } -CORBA::Boolean +CORBA::Boolean VISU::Result_i -::IsEntitiesDone() +::IsEntitiesDone() { return myIsEntitiesDone; } void VISU::Result_i -::SetBuildFields(CORBA::Boolean theIsBuildFields, - CORBA::Boolean theIsCalculateMinMax) +::SetBuildFields(CORBA::Boolean theIsBuildFields, + CORBA::Boolean theIsCalculateMinMax) { myIsBuildFields = theIsBuildFields; if(theIsBuildFields) @@ -957,28 +956,28 @@ VISU::Result_i myIsBuildGroups = theIsBuildGroups; } -CORBA::Boolean +CORBA::Boolean VISU::Result_i -::IsFieldsDone() +::IsFieldsDone() { return myIsFieldsDone; } -CORBA::Boolean +CORBA::Boolean VISU::Result_i -::IsGroupsDone() +::IsGroupsDone() { return myIsGroupsDone; } -CORBA::Boolean +CORBA::Boolean VISU::Result_i -::IsMinMaxDone() +::IsMinMaxDone() { return myIsMinMaxDone; } -CORBA::Boolean +CORBA::Boolean VISU::Result_i ::IsPartsDone() { @@ -987,7 +986,7 @@ VISU::Result_i //--------------------------------------------------------------- -VISU::Result::EntityNames* +VISU::Result::EntityNames* VISU::Result_i ::GetMeshNames() { @@ -1002,13 +1001,13 @@ VISU::Result_i const std::string& aName = anIter->first; aResult[anId] = aName.c_str(); } - + return aResult._retn(); } //--------------------------------------------------------------- -VISU::Result::Entities* +VISU::Result::Entities* VISU::Result_i ::GetEntities(const char* theMeshName) { @@ -1020,7 +1019,7 @@ VISU::Result_i VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName); if(anIter == aMeshMap.end()) return anEntities._retn(); - + const VISU::PMesh& aMesh = anIter->second; const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap; if(aMeshOnEntityMap.empty()) @@ -1040,10 +1039,10 @@ VISU::Result_i //--------------------------------------------------------------- -VISU::Result::EntityNames* +VISU::Result::EntityNames* VISU::Result_i -::GetFamilies(const char* theMeshName, - VISU::Entity theEntity) +::GetFamilies(const char* theMeshName, + VISU::Entity theEntity) { VISU::Result::EntityNames_var aResult = new VISU::Result::EntityNames(); const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap(); @@ -1053,7 +1052,7 @@ VISU::Result_i VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName); if(anIter == aMeshMap.end()) return aResult._retn(); - + const VISU::PMesh& aMesh = anIter->second; const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap; if(aMeshOnEntityMap.empty()) @@ -1069,13 +1068,13 @@ VISU::Result_i const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; if(aFamilyMap.empty()) return aResult._retn(); - + { aResult->length(aFamilyMap.size()); VISU::TFamilyMap::const_iterator anIter = aFamilyMap.begin(); for(size_t anId = 0; anIter != aFamilyMap.end(); anIter++, anId++){ - const std::string& aName = anIter->first; - aResult[anId] = aName.c_str(); + const std::string& aName = anIter->first; + aResult[anId] = aName.c_str(); } } } @@ -1085,7 +1084,7 @@ VISU::Result_i //--------------------------------------------------------------- -VISU::Result::EntityNames* +VISU::Result::EntityNames* VISU::Result_i ::GetGroups(const char* theMeshName) { @@ -1097,7 +1096,7 @@ VISU::Result_i VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName); if(anIter == aMeshMap.end()) return aResult._retn(); - + const VISU::PMesh& aMesh = anIter->second; const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap; if(aGroupMap.empty()) @@ -1119,8 +1118,8 @@ VISU::Result_i //--------------------------------------------------------------- VISU::Result::EntityNames* VISU::Result_i -::GetFields(const char* theMeshName, - VISU::Entity theEntity) +::GetFields(const char* theMeshName, + VISU::Entity theEntity) { VISU::Result::EntityNames_var aResult = new VISU::Result::EntityNames(); const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap(); @@ -1130,7 +1129,7 @@ VISU::Result_i VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName); if(anIter == aMeshMap.end()) return aResult._retn(); - + const VISU::PMesh& aMesh = anIter->second; const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap; if(aMeshOnEntityMap.empty()) @@ -1146,13 +1145,13 @@ VISU::Result_i const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; if(aFieldMap.empty()) return aResult._retn(); - + { aResult->length(aFieldMap.size()); VISU::TFieldMap::const_iterator anIter = aFieldMap.begin(); for(size_t anId = 0; anIter != aFieldMap.end(); anIter++, anId++){ - const std::string& aName = anIter->first; - aResult[anId] = aName.c_str(); + const std::string& aName = anIter->first; + aResult[anId] = aName.c_str(); } } } @@ -1162,11 +1161,11 @@ VISU::Result_i //--------------------------------------------------------------- -VISU::Result::TimeStampNumbers* +VISU::Result::TimeStampNumbers* VISU::Result_i -::GetTimeStampNumbers(const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName) +::GetTimeStampNumbers(const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName) { VISU::Result::TimeStampNumbers_var aResult = new VISU::Result::TimeStampNumbers(); const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap(); @@ -1176,7 +1175,7 @@ VISU::Result_i VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName); if(anIter == aMeshMap.end()) return aResult._retn(); - + const VISU::PMesh& aMesh = anIter->second; const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap; if(aMeshOnEntityMap.empty()) @@ -1196,22 +1195,22 @@ VISU::Result_i { VISU::TFieldMap::const_iterator anIter = aFieldMap.find(theFieldName); if(anIter == aFieldMap.end()) - return aResult._retn(); + return aResult._retn(); { - const VISU::PField& aField = anIter->second; - const VISU::TValField& aValField = aField->myValField; - if(aValField.empty()) - return aResult._retn(); - - { - aResult->length(aValField.size()); - VISU::TValField::const_iterator anIter = aValField.begin(); - for(size_t anId = 0; anIter != aValField.end(); anIter++, anId++){ - const vtkIdType& aTimeStampNumber = anIter->first; - aResult[anId] = aTimeStampNumber; - } - } + const VISU::PField& aField = anIter->second; + const VISU::TValField& aValField = aField->myValField; + if(aValField.empty()) + return aResult._retn(); + + { + aResult->length(aValField.size()); + VISU::TValField::const_iterator anIter = aValField.begin(); + for(size_t anId = 0; anIter != aValField.end(); anIter++, anId++){ + const vtkIdType& aTimeStampNumber = anIter->first; + aResult[anId] = aTimeStampNumber; + } + } } } } @@ -1223,9 +1222,9 @@ VISU::Result_i //--------------------------------------------------------------- VISU::double_array* VISU::Result_i -::GetTimeStampValues(const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName) +::GetTimeStampValues(const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName) { VISU::double_array_var aResult = new VISU::double_array(); const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap(); @@ -1235,7 +1234,7 @@ VISU::Result_i VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName); if(anIter == aMeshMap.end()) return aResult._retn(); - + const VISU::PMesh& aMesh = anIter->second; const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap; if(aMeshOnEntityMap.empty()) @@ -1255,22 +1254,22 @@ VISU::Result_i { VISU::TFieldMap::const_iterator anIter = aFieldMap.find(theFieldName); if(anIter == aFieldMap.end()) - return aResult._retn(); + return aResult._retn(); { - const VISU::PField& aField = anIter->second; - const VISU::TValField& aValField = aField->myValField; - if(aValField.empty()) - return aResult._retn(); - - { - aResult->length(aValField.size()); - VISU::TValField::const_iterator anIter = aValField.begin(); - for(size_t anId = 0; anIter != aValField.end(); anIter++, anId++){ - const PValForTime& aValForTime = anIter->second; - aResult[anId] = aValForTime->myTime.first; - } - } + const VISU::PField& aField = anIter->second; + const VISU::TValField& aValField = aField->myValField; + if(aValField.empty()) + return aResult._retn(); + + { + aResult->length(aValField.size()); + VISU::TValField::const_iterator anIter = aValField.begin(); + for(size_t anId = 0; anIter != aValField.end(); anIter++, anId++){ + const PValForTime& aValForTime = anIter->second; + aResult[anId] = aValForTime->myTime.first; + } + } } } } @@ -1280,11 +1279,11 @@ VISU::Result_i //--------------------------------------------------------------- -CORBA::Long +CORBA::Long VISU::Result_i -::GetNumberOfComponents(const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName) +::GetNumberOfComponents(const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName) { CORBA::Long aResult = 0; const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap(); @@ -1294,7 +1293,7 @@ VISU::Result_i VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName); if(anIter == aMeshMap.end()) return aResult; - + const VISU::PMesh& aMesh = anIter->second; const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap; if(aMeshOnEntityMap.empty()) @@ -1314,11 +1313,11 @@ VISU::Result_i { VISU::TFieldMap::const_iterator anIter = aFieldMap.find(theFieldName); if(anIter == aFieldMap.end()) - return aResult; + return aResult; { - const VISU::PField& aField = anIter->second; - aResult = aField->myNbComp; + const VISU::PField& aField = anIter->second; + aResult = aField->myNbComp; } } } @@ -1328,7 +1327,7 @@ VISU::Result_i //--------------------------------------------------------------- -VISU::Result::EntityNames* +VISU::Result::EntityNames* VISU::Result_i ::GetPartNames(const char* theMeshName) { @@ -1338,10 +1337,10 @@ VISU::Result_i //--------------------------------------------------------------- -VISU::Result::Resolutions* +VISU::Result::Resolutions* VISU::Result_i -::GetResolutions(const char* theMeshName, - const char* thePartName) +::GetResolutions(const char* theMeshName, + const char* thePartName) { VISU::Result::Resolutions_var aResult = new VISU::Result::Resolutions(); return aResult._retn(); @@ -1351,19 +1350,19 @@ VISU::Result_i //--------------------------------------------------------------- VISU::Result::Resolution VISU::Result_i -::GetResolution(const char* theMeshName, - const char* thePartName) +::GetResolution(const char* theMeshName, + const char* thePartName) { return VISU::Result::HIDDEN; } //--------------------------------------------------------------- -void +void VISU::Result_i -::SetResolution(const char* theMeshName, - const char* thePartName, - VISU::Result::Resolution theResolution) +::SetResolution(const char* theMeshName, + const char* thePartName, + VISU::Result::Resolution theResolution) {} @@ -1379,12 +1378,12 @@ VISU::Result_i CORBA::Boolean theIsBuildGroups) { return new RESULT_CLASS_NAME(theStudy, - theSourceId, - theCreationId, - theIsBuildImmediately, - theIsBuildFields, - theIsBuildMinMax, - theIsBuildGroups); + theSourceId, + theCreationId, + theIsBuildImmediately, + theIsBuildFields, + theIsBuildMinMax, + theIsBuildGroups); } @@ -1392,9 +1391,9 @@ VISU::Result_i VISU::Storable* VISU::Result_i ::StorableEngine(SALOMEDS::SObject_ptr theSObject, - const Storable::TRestoringMap& theMap, - const std::string& thePrefix, - CORBA::Boolean theIsMultiFile) + const Storable::TRestoringMap& theMap, + const std::string& thePrefix, + CORBA::Boolean theIsMultiFile) { VISU::Result_i* aResult = new RESULT_CLASS_NAME(); return aResult->Restore(theSObject, theMap, thePrefix, theIsMultiFile); @@ -1402,7 +1401,7 @@ VISU::Result_i //--------------------------------------------------------------- -void +void VISU::Result_i ::ToStream(std::ostringstream& theStr) { @@ -1425,7 +1424,7 @@ VISU::Result_i aCommand.sprintf(" %s %s", aTempFileName, theTargetFileName); aCommand = QDir::convertSeparators( aCommand ); aCommand.prepend( COPY_COMMAND ); - + if(system(aCommand.toLatin1().data()) != 0) { if(MYDEBUG) MESSAGE("VISU_Gen_i::Copy - Cann't execute the command :"<second; VISU::PUnstructuredGridIDMapper anIDMapper = myInput->GetMeshOnEntity(theMeshName, - CELL_ENTITY); + CELL_ENTITY); vtkUnstructuredGrid* aMesh = anIDMapper->GetUnstructuredGridOutput(); if ( !aMesh || aMesh->GetNumberOfCells() == 0 ) { @@ -1587,50 +1586,50 @@ VISU::Result_i float minSize[3] = { FLT_MAX, FLT_MAX, FLT_MAX }; bool axesComputed = false; for ( vtkIdType iCell = 0; iCell < aMesh->GetNumberOfCells(); ++iCell ) { - vtkCell* cell = aMesh->GetCell( iCell ); - - if (cell->GetCellType() != VTK_HEXAHEDRON && - cell->GetCellType() != VTK_QUADRATIC_HEXAHEDRON ) - continue; - vtkPoints * points = cell->GetPoints(); - vtkFloatingPointType coords[ 4 ][3]; - points->GetPoint( 0, coords[0] ); - points->GetPoint( 1, coords[1] ); - points->GetPoint( 3, coords[2] ); - points->GetPoint( 4, coords[3] ); - gp_Pnt p0( coords[0][0], coords[0][1], coords[0][2] ); - for ( iAx = 0; iAx < nbAxes; ++iAx ) { - vtkFloatingPointType* coo = coords[ iAx + 1 ]; - gp_Pnt p( coo[0], coo[1], coo[2] ); - // min size - vtkFloatingPointType size = p0.SquareDistance( p ); - if ( size > FLT_MIN && size < minSize[ iAx ] ) - minSize[ iAx ] = size; - // axis direction - if ( !axesComputed ) { - gp_Vec dir( p0, p ); - if ( dir.SquareMagnitude() <= gp::Resolution() ) { - break; - } - axDirs[ iAx ] = dir; - } - } - if ( iAx == nbAxes ) - axesComputed = true; + vtkCell* cell = aMesh->GetCell( iCell ); + + if (cell->GetCellType() != VTK_HEXAHEDRON && + cell->GetCellType() != VTK_QUADRATIC_HEXAHEDRON ) + continue; + vtkPoints * points = cell->GetPoints(); + vtkFloatingPointType coords[ 4 ][3]; + points->GetPoint( 0, coords[0] ); + points->GetPoint( 1, coords[1] ); + points->GetPoint( 3, coords[2] ); + points->GetPoint( 4, coords[3] ); + gp_Pnt p0( coords[0][0], coords[0][1], coords[0][2] ); + for ( iAx = 0; iAx < nbAxes; ++iAx ) { + vtkFloatingPointType* coo = coords[ iAx + 1 ]; + gp_Pnt p( coo[0], coo[1], coo[2] ); + // min size + vtkFloatingPointType size = p0.SquareDistance( p ); + if ( size > FLT_MIN && size < minSize[ iAx ] ) + minSize[ iAx ] = size; + // axis direction + if ( !axesComputed ) { + gp_Vec dir( p0, p ); + if ( dir.SquareMagnitude() <= gp::Resolution() ) { + break; + } + axDirs[ iAx ] = dir; + } + } + if ( iAx == nbAxes ) + axesComputed = true; } if ( !axesComputed ) { - MESSAGE("No good hexahedrons in the mesh: " << theMeshName ); - return components; + MESSAGE("No good hexahedrons in the mesh: " << theMeshName ); + return components; } - + // compute axes dirs gInfo = & myMeshName2GridInfoMap[ theMeshName ]; for ( iAx = 0; iAx < nbAxes; ++iAx ) { - int iPrev = ( iAx == 0 ) ? 2 : iAx - 1; - int iNext = ( iAx == 2 ) ? 0 : iAx + 1; - gInfo->myAxis[ iAx ] = axDirs[ iPrev ] ^ axDirs[ iNext ]; + int iPrev = ( iAx == 0 ) ? 2 : iAx - 1; + int iNext = ( iAx == 2 ) ? 0 : iAx + 1; + gInfo->myAxis[ iAx ] = axDirs[ iPrev ] ^ axDirs[ iNext ]; } - + // get and sort intermediate component values - projections of nodes // on axis direction; define bnd box set< vtkFloatingPointType > comps[ 3 ]; @@ -1638,60 +1637,60 @@ VISU::Result_i vtkPoints * points = aMesh->GetPoints(); vtkIdType iP, nbP = aMesh->GetNumberOfPoints(); for ( iP = 0; iP < nbP; ++iP ) { - vtkFloatingPointType coo[3]; - points->GetPoint( iP, coo ); - gp_Pnt p( coo[0], coo[1], coo[2] ); - box.Add( p ); - for ( iAx = 0; iAx < nbAxes; ++iAx ) { - const gp_Dir& dir = gInfo->myAxis[ iAx ]; - vtkFloatingPointType dot = dir.XYZ() * p.XYZ(); - comps[ iAx ].insert( dot ); - } + vtkFloatingPointType coo[3]; + points->GetPoint( iP, coo ); + gp_Pnt p( coo[0], coo[1], coo[2] ); + box.Add( p ); + for ( iAx = 0; iAx < nbAxes; ++iAx ) { + const gp_Dir& dir = gInfo->myAxis[ iAx ]; + vtkFloatingPointType dot = dir.XYZ() * p.XYZ(); + comps[ iAx ].insert( dot ); + } } - + // find a range of projections of bnd box corners on each axis vtkFloatingPointType range[3], firstValue[3]; double x[2],y[2],z[2]; box.Get(x[0],y[0],z[0],x[1],y[1],z[1]); for ( iAx = 0; iAx < nbAxes; ++iAx ) { - set< vtkFloatingPointType > bndComps; - const gp_Dir& dir = gInfo->myAxis[ iAx ]; - for ( int iX = 0; iX < 2; ++iX ) { - for ( int iY = 0; iY < 2; ++iY ) { - for ( int iZ = 0; iZ < 2; ++iZ ) { - gp_Pnt p( x[ iX ], y[ iY ], z[ iZ ] ); - vtkFloatingPointType dot = dir.XYZ() * p.XYZ(); - bndComps.insert( dot ); - } - } - } - firstValue[ iAx ] = *bndComps.begin(); - range[ iAx ] = *bndComps.rbegin() - *bndComps.begin(); + set< vtkFloatingPointType > bndComps; + const gp_Dir& dir = gInfo->myAxis[ iAx ]; + for ( int iX = 0; iX < 2; ++iX ) { + for ( int iY = 0; iY < 2; ++iY ) { + for ( int iZ = 0; iZ < 2; ++iZ ) { + gp_Pnt p( x[ iX ], y[ iY ], z[ iZ ] ); + vtkFloatingPointType dot = dir.XYZ() * p.XYZ(); + bndComps.insert( dot ); + } + } + } + firstValue[ iAx ] = *bndComps.begin(); + range[ iAx ] = *bndComps.rbegin() - *bndComps.begin(); } - + // compute component values for ( iAx = 0; iAx < nbAxes; ++iAx ) { - list< vtkFloatingPointType > values; - int nbVals = 0; - set< vtkFloatingPointType >& comp = comps[ iAx ]; - set< vtkFloatingPointType >::iterator val = comp.begin(); - vtkFloatingPointType bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ]; - vtkFloatingPointType tol = 0.1 * sqrt( minSize[ iAx ]) / rng; - for ( ; val != comp.end(); ++val ) { - vtkFloatingPointType value = ( *val - first ) / rng; - if ( value > bnd ) { - values.push_back( value ); - bnd = value + tol; - nbVals++; - } - } - // store values in gInfo - vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ iAx ]; - myComp.resize( nbVals ); - list< vtkFloatingPointType >::iterator v = values.begin(); - for ( int i = 0; v != values.end(); ++v ){ - myComp[ i++ ] = *v; - } + list< vtkFloatingPointType > values; + int nbVals = 0; + set< vtkFloatingPointType >& comp = comps[ iAx ]; + set< vtkFloatingPointType >::iterator val = comp.begin(); + vtkFloatingPointType bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ]; + vtkFloatingPointType tol = 0.1 * sqrt( minSize[ iAx ]) / rng; + for ( ; val != comp.end(); ++val ) { + vtkFloatingPointType value = ( *val - first ) / rng; + if ( value > bnd ) { + values.push_back( value ); + bnd = value + tol; + nbVals++; + } + } + // store values in gInfo + vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ iAx ]; + myComp.resize( nbVals ); + list< vtkFloatingPointType >::iterator v = values.begin(); + for ( int i = 0; v != values.end(); ++v ){ + myComp[ i++ ] = *v; + } } } else { @@ -1699,66 +1698,66 @@ VISU::Result_i gInfo = & myMeshName2GridInfoMap[ theMeshName ]; switch ( aMeshDim ) { case 3: { - gp_Dir aDir(0.0,0.0,1.0); - gInfo->myAxis[ 2 ] = aDir; + gp_Dir aDir(0.0,0.0,1.0); + gInfo->myAxis[ 2 ] = aDir; } case 2: { - gp_Dir aDir(0.0,1.0,0.0); - gInfo->myAxis[ 1 ] = aDir; + gp_Dir aDir(0.0,1.0,0.0); + gInfo->myAxis[ 1 ] = aDir; } case 1: { - gp_Dir aDir(1.0,0.0,0.0); - gInfo->myAxis[ 0 ] = aDir; + gp_Dir aDir(1.0,0.0,0.0); + gInfo->myAxis[ 0 ] = aDir; }} - + TStructuredId aStructuredId = theMesh->GetStructure(); vector PointsCoords[3]; vtkPoints* aPoints = aMesh->GetPoints(); switch ( aMeshDim ) { case 3: { - TStructuredId aCoordIJK; - vtkIdType nbZ = aStructuredId[2]; - for ( int i = 0; i < nbZ; i++ ) { - aCoordIJK[2] = i + 1; - vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK); - vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID); - vtkFloatingPointType* aPCoord = aPoints->GetPoint(aVTKID); - PointsCoords[2].push_back(aPCoord[2]); - } + TStructuredId aCoordIJK; + vtkIdType nbZ = aStructuredId[2]; + for ( int i = 0; i < nbZ; i++ ) { + aCoordIJK[2] = i + 1; + vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK); + vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID); + vtkFloatingPointType* aPCoord = aPoints->GetPoint(aVTKID); + PointsCoords[2].push_back(aPCoord[2]); + } } case 2: { - TStructuredId aCoordIJK; - vtkIdType nbJ = aStructuredId[1]; - for ( int i = 0; i < nbJ; i++ ) { - aCoordIJK[1] = i + 1; - vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK); - vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID); - vtkFloatingPointType* aPCoord = aPoints->GetPoint(aVTKID); - PointsCoords[1].push_back(aPCoord[1]); - } + TStructuredId aCoordIJK; + vtkIdType nbJ = aStructuredId[1]; + for ( int i = 0; i < nbJ; i++ ) { + aCoordIJK[1] = i + 1; + vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK); + vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID); + vtkFloatingPointType* aPCoord = aPoints->GetPoint(aVTKID); + PointsCoords[1].push_back(aPCoord[1]); + } } case 1: { - TStructuredId aCoordIJK; - vtkIdType nbI = aStructuredId[0]; - for ( int i = 0; i < nbI; i++ ) { - aCoordIJK[0] = i + 1; - vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK); - vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID); - vtkFloatingPointType* aPCoord = aPoints->GetPoint(aVTKID); - PointsCoords[0].push_back(aPCoord[0]); - } + TStructuredId aCoordIJK; + vtkIdType nbI = aStructuredId[0]; + for ( int i = 0; i < nbI; i++ ) { + aCoordIJK[0] = i + 1; + vtkIdType aObjID = anIDMapper->GetObjectIDByIndexes(aCoordIJK); + vtkIdType aVTKID = anIDMapper->GetNodeVTKID(aObjID); + vtkFloatingPointType* aPCoord = aPoints->GetPoint(aVTKID); + PointsCoords[0].push_back(aPCoord[0]); + } }} for ( int i = 0; i < aMeshDim; i++ ) { - vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ i ]; - int aSize = PointsCoords[i].size(); - if ( aSize > 0 ) { - vtkFloatingPointType aLen = PointsCoords[i][aSize-1] - PointsCoords[i][0]; - myComp.resize(aSize); - myComp[0] = 0; - for ( int k = 1; k < aSize; k++ ) { - myComp[k]=myComp[k-1] + (PointsCoords[i][k]-PointsCoords[i][k-1])/aLen; - } - } + vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ i ]; + int aSize = PointsCoords[i].size(); + if ( aSize > 0 ) { + vtkFloatingPointType aLen = PointsCoords[i][aSize-1] - PointsCoords[i][0]; + myComp.resize(aSize); + myComp[0] = 0; + for ( int k = 1; k < aSize; k++ ) { + myComp[k]=myComp[k-1] + (PointsCoords[i][k]-PointsCoords[i][k-1])/aLen; + } + } } } } -- 2.39.2