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 "SALOME_GenericObj_i.hh"
33 #include <boost/signals/trackable.hpp>
34 #include <boost/signals/signal0.hpp>
43 //----------------------------------------------------------------------------
44 class MinMaxCunsomer: public virtual boost::bsignals::trackable
47 bool myMinMaxIsInitilized;
61 //----------------------------------------------------------------------------
62 class Result_i : public virtual POA_VISU::Result,
63 public virtual RemovableObject_i,
64 public virtual SALOME::GenericObj_i
67 Result_i(const Result_i &);
70 enum ESourceId {eRestoredComponent = -2, eRestoredFile = -1, eFile = 1, eComponent = 2};
71 enum ECreationId {eImportFile, eCopyAndImportFile, eImportMed, eImportMedField};
73 Result_i(SALOMEDS::Study_ptr theStudy,
74 const ESourceId& theSourceId,
75 const ECreationId& theCreationId,
76 CORBA::Boolean theIsBuildImmediately = true);
79 virtual void RemoveFromStudy();
81 virtual VISU::VISUType GetType() { return VISU::TRESULT;}
82 virtual CORBA::Boolean BuildAll();
84 virtual CORBA::Boolean Build(CORBA::Boolean theIsBuildAll,
85 CORBA::Boolean theIsAtOnce);
86 virtual CORBA::Boolean IsDone();
88 virtual CORBA::Boolean IsEntitiesDone();
90 virtual void SetBuildFields(CORBA::Boolean theIsBuildFields,
91 CORBA::Boolean theIsCalculateMinMax);
92 virtual CORBA::Boolean IsFieldsDone();
94 virtual void SetBuildGroups(CORBA::Boolean theIsBuildGroups);
95 virtual CORBA::Boolean IsGroupsDone();
97 virtual CORBA::Boolean IsMinMaxDone();
101 MinMaxConnect(MinMaxCunsomer* theMinMaxCunsomer);
103 typedef boost::signal0<void> TUpdateMinMaxSignal;
105 typedef VISU_Convertor TInput;
108 ESourceId mySourceId;
109 ECreationId myCreationId;
112 std::string myName, myInitFileName;
113 QFileInfo myFileInfo;
116 virtual Storable* Build(SALOMEDS::SObject_ptr theSObject,
117 CORBA::Boolean theIsAtOnce = true) ;
118 virtual Storable* BuildAll(SALOMEDS::SObject_ptr theSObject) ;
121 CORBA::Boolean myIsBuildImmediately;
123 CORBA::Boolean myIsEntitiesDone;
124 CORBA::Boolean myIsFieldsDone;
125 CORBA::Boolean myIsGroupsDone;
126 CORBA::Boolean myIsMinMaxDone;
128 CORBA::Boolean myIsBuildFields;
129 CORBA::Boolean myIsBuildGroups;
131 CORBA::Boolean myIsBuildMinMax;
132 TUpdateMinMaxSignal myUpdateMinMaxSignal;
134 CORBA::Boolean myIsAllDone;
137 virtual int IsPossible();
139 virtual Storable* Create(const char* theFileName);
140 virtual Storable* Create(SALOMEDS::SObject_ptr theMedSObject);
141 virtual Storable* Create(SALOME_MED::FIELD_ptr theField);
143 virtual Storable* Restore(SALOMEDS::SObject_ptr theSObject,
144 const Storable::TRestoringMap& theMap,
145 const std::string& thePrefix);
147 static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
148 const std::string& thePrefix,
149 const Storable::TRestoringMap& theMap);
151 virtual void ToStream(std::ostringstream& theStr);
152 virtual const char* GetComment() const;
153 static const std::string myComment;
156 const std::string& GetName() const { return myName;}
157 const QFileInfo& GetFileInfo() const { return myFileInfo;}
158 const std::string& GetFileName() const { return myInitFileName;}
159 const ECreationId& GetCreationId() const { return myCreationId;}
162 SALOMEDS::SObject_var mySObject;
163 SALOMEDS::Study_var myStudyDocument;
164 SALOMEDS::SComponent_var mySComponent;
167 std::string GetRefFatherEntry();
168 std::string GetEntry();
169 const SALOMEDS::SObject_var& GetSObject() const;
170 const SALOMEDS::Study_var& GetStudyDocument() const;
171 const SALOMEDS::SComponent_var& GetSComponent() const;
172 std::string GetEntry(const std::string& theComment);
174 // Info on structured mesh contained in TInput
176 typedef enum { AXIS_X = 0, AXIS_Y, AXIS_Z } TAxis;
177 const std::vector< float >* GetAxisInfo(const std::string& theMeshName,
179 gp_Dir& thePlaneNormal);
180 // Return i,j or k values and cutting plane normal for theAxis.
181 // In the case of any problems, return NULL pointer
184 std::vector< float > myComponets[ 3 ];
187 map< string, TGridInfo > myMeshName2GridInfoMap;
190 Result_var FindResult(SALOMEDS::SObject_ptr theSObject);