1 // VISU OBJECT : interactive object for VISU entities implementation
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
23 // File : VISU_Result_i.hh
24 // Author : Alexey PETROV
27 #ifndef __VISU_RESULT_I_H__
28 #define __VISU_RESULT_I_H__
30 #include "VISUConfig.hh"
31 #include "VISU_BoostSignals.h"
32 #include "SALOME_GenericObj_i.hh"
41 //----------------------------------------------------------------------------
42 class MinMaxCunsomer: public virtual boost::signalslib::trackable
45 bool myMinMaxIsInitilized;
59 //----------------------------------------------------------------------------
60 class Result_i : public virtual POA_VISU::Result,
61 public virtual RemovableObject_i,
62 public virtual SALOME::GenericObj_i
65 Result_i(const Result_i &);
68 enum ESourceId {eRestoredComponent = -2, eRestoredFile = -1, eFile = 1, eComponent = 2};
69 enum ECreationId {eImportFile, eCopyAndImportFile, eImportMed, eImportMedField};
71 Result_i(SALOMEDS::Study_ptr theStudy,
72 const ESourceId& theSourceId,
73 const ECreationId& theCreationId,
74 CORBA::Boolean theIsBuildImmediately = true,
75 CORBA::Boolean theIsBuildFields = true,
76 CORBA::Boolean theIsBuildMinMax = true,
77 CORBA::Boolean theIsBuildGroups = true);
80 virtual void RemoveFromStudy();
82 virtual VISU::VISUType GetType() { return VISU::TRESULT;}
83 virtual CORBA::Boolean BuildAll();
85 virtual CORBA::Boolean Build(CORBA::Boolean theIsBuildAll,
86 CORBA::Boolean theIsAtOnce);
87 virtual CORBA::Boolean IsDone();
89 virtual CORBA::Boolean IsEntitiesDone();
91 virtual void SetBuildFields(CORBA::Boolean theIsBuildFields,
92 CORBA::Boolean theIsCalculateMinMax);
93 virtual CORBA::Boolean IsFieldsDone();
95 virtual void SetBuildGroups(CORBA::Boolean theIsBuildGroups);
96 virtual CORBA::Boolean IsGroupsDone();
98 virtual CORBA::Boolean IsMinMaxDone();
102 MinMaxConnect(MinMaxCunsomer* theMinMaxCunsomer);
104 typedef boost::signal0<void> TUpdateMinMaxSignal;
106 typedef VISU_Convertor TInput;
109 ESourceId mySourceId;
110 ECreationId myCreationId;
113 std::string myName, myInitFileName;
114 QFileInfo myFileInfo;
117 virtual Storable* Build(SALOMEDS::SObject_ptr theSObject,
118 CORBA::Boolean theIsAtOnce = true) ;
119 virtual Storable* BuildAll(SALOMEDS::SObject_ptr theSObject) ;
122 CORBA::Boolean myIsBuildImmediately;
124 CORBA::Boolean myIsEntitiesDone;
125 CORBA::Boolean myIsFieldsDone;
126 CORBA::Boolean myIsGroupsDone;
127 CORBA::Boolean myIsMinMaxDone;
129 CORBA::Boolean myIsBuildFields;
130 CORBA::Boolean myIsBuildGroups;
132 CORBA::Boolean myIsBuildMinMax;
133 TUpdateMinMaxSignal myUpdateMinMaxSignal;
135 CORBA::Boolean myIsAllDone;
138 virtual int IsPossible();
140 virtual Storable* Create(const char* theFileName);
141 virtual Storable* Create(SALOMEDS::SObject_ptr theMedSObject);
142 virtual Storable* Create(SALOME_MED::FIELD_ptr theField);
144 virtual Storable* Restore(SALOMEDS::SObject_ptr theSObject,
145 const Storable::TRestoringMap& theMap,
146 const std::string& thePrefix);
148 static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
149 const std::string& thePrefix,
150 const Storable::TRestoringMap& theMap);
152 virtual void ToStream(std::ostringstream& theStr);
153 virtual const char* GetComment() const;
154 static const std::string myComment;
157 const std::string& GetName() const { return myName;}
158 const QFileInfo& GetFileInfo() const { return myFileInfo;}
159 const std::string& GetFileName() const { return myInitFileName;}
160 const ECreationId& GetCreationId() const { return myCreationId;}
163 SALOMEDS::SObject_var mySObject;
164 SALOMEDS::Study_var myStudyDocument;
165 SALOMEDS::SComponent_var mySComponent;
168 std::string GetRefFatherEntry();
169 std::string GetEntry();
170 const SALOMEDS::SObject_var& GetSObject() const;
171 const SALOMEDS::Study_var& GetStudyDocument() const;
172 const SALOMEDS::SComponent_var& GetSComponent() const;
173 std::string GetEntry(const std::string& theComment);
175 // Info on structured mesh contained in TInput
177 typedef enum { AXIS_X = 0, AXIS_Y, AXIS_Z } TAxis;
178 const std::vector< float >* GetAxisInfo(const std::string& theMeshName,
180 gp_Dir& thePlaneNormal);
181 // Return i,j or k values and cutting plane normal for theAxis.
182 // In the case of any problems, return NULL pointer
185 std::vector< float > myComponets[ 3 ];
188 map< string, TGridInfo > myMeshName2GridInfoMap;
191 Result_var FindResult(SALOMEDS::SObject_ptr theSObject);