-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VISU_Gen_i.hh
// Author : Alexey Petrov
// Module : VISU
-
+//
#ifndef __VISU_GEN_I_H__
#define __VISU_GEN_I_H__
#include "VISUConfig.hh"
+#include "VISU_I.hxx"
#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
+#include "VISU_ColoredPrs3d_i.hh"
+#include "VISU_ClippingPlaneMgr.hxx"
+
+#include <VTKViewer_MarkerDef.h>
+#include <map>
#include <string>
namespace VISU
{
- class Result_i;
- class ColoredPrs3d_i;
-
- bool
- CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration);
+ //----------------------------------------------------------------------------
+ typedef std::map<int, VTK::MarkerMap> StudyId2MarkerMap;
+ //----------------------------------------------------------------------------
class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
public virtual ::Engines_Component_i,
public virtual Base_i
{
SALOMEDS::Study_var myStudyDocument;
- VISU_Gen_i();
+ VISU_ClippingPlaneMgr myClippingPlaneMgr;
+
+ StudyId2MarkerMap myMarkerMap;
+
VISU_Gen_i(const VISU::VISU_Gen_i &);
public:
VISU_Gen_i(CORBA::ORB_ptr theORB,
PortableServer::POA_ptr thePOA,
SALOME_NamingService* theNamingService,
QMutex* theMutex);
- virtual ~VISU_Gen_i();
+
+ virtual
+ ~VISU_Gen_i();
virtual
char*
virtual
SALOMEDS::SObject_ptr
- ImportTables(const char* theFileName);
+ ImportTables(const char* theFileName, bool theFirstStrAsTitle = false);
virtual
CORBA::Boolean
const char* theFileName );
//Create Result
- virtual
+ virtual
Result_ptr
ImportFile(const char* theFileName);
//Rename Presentation Of Submeshes
void
- RenameMeshInStudy(Result_ptr theResult,
- std::string theMeshName,
- int theEntity, // -1 for group indication
- std::string theSubMeshName, // Family or Group name
- std::string theNewName);
+ 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);
virtual
void
RenameEntityInStudy(Result_ptr theResult,
virtual
void
RenameGroupInStudy(Result_ptr theResult,
- const char* theMeshName,
+ const char* theMeshName,
const char* theGroupName,
const char* theNewName);
const char* theMeshName,
const char* theGroupName);
- //Create 3D collored Presentation Of Different Types
- template<typename TPrs3d_i> TPrs3d_i*
- CreatePrs3d(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration,
- bool theAddToStudy = true)
- {
- if(myStudyDocument->GetProperties()->IsLocked())
- return NULL;
-
- typedef typename TPrs3d_i::TInterface TPrs3d;
- typename TPrs3d::_var_type aPrs3d;
- Mutex mt(myMutex);
- if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
- if(TPrs3d_i::IsPossible(aResult,theMeshName,theEntity,theFieldName,int(theIteration))){
- TPrs3d_i* aPresent = new TPrs3d_i(aResult,theAddToStudy);
- if(CreatColoredPrs3d(aPresent,theMeshName,theEntity,theFieldName,theIteration))
- return aPresent;
- aPresent->_remove_ref();
- }
- }
- return NULL;
- }
-
- template<typename TPrs3d_i> typename TPrs3d_i::TInterface::_var_type
- Prs3dOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration,
- bool theAddToStudy = true)
- {
- typedef typename TPrs3d_i::TInterface TPrs3d;
- typename TPrs3d::_var_type aPrs3d;
- if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,theAddToStudy))
- return aPrs3d->_this();
- return TPrs3d::_nil();
- }
+ Prs3d_ptr
+ CreatePrs3d(VISUType theType,
+ SALOMEDS::Study_ptr theStudy);
virtual
ScalarMap_ptr
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration);
+ CORBA::Long theIteration);
virtual
GaussPoints_ptr
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration);
+ CORBA::Long theIteration);
virtual
DeformedShape_ptr
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration);
+ CORBA::Long theIteration);
+ //This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
virtual
- ScalarMapOnDeformedShape_ptr
+ DeformedShapeAndScalarMap_ptr
ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration);
+ CORBA::Long theIteration);
+
+ virtual
+ DeformedShapeAndScalarMap_ptr
+ DeformedShapeAndScalarMapOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
+
virtual
Vectors_ptr
VectorsOnField(Result_ptr theResult,
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration);
+ CORBA::Long theIteration);
virtual
IsoSurfaces_ptr
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration);
+ CORBA::Long theIteration);
virtual
CutPlanes_ptr
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration);
+ CORBA::Long theIteration);
virtual
CutLines_ptr
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration);
+ CORBA::Long theIteration);
+
+ virtual
+ CutSegment_ptr
+ CutSegmentOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
virtual
StreamLines_ptr
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration);
+ CORBA::Long theIteration);
virtual
Plot3D_ptr
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration);
+ CORBA::Long theIteration);
//Create Digital Presentation
virtual
CORBA::Long theHRow,
CORBA::Long theVRow);
+ virtual
+ Curve_ptr
+ CreateCurveWithZ(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow);
+
+ virtual
+ Curve_ptr
+ CreateCurveWithZExt(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow,
+ CORBA::Boolean theIsV2);
+
virtual
Container_ptr
CreateContainer();
Animation_ptr
CreateAnimation(View3D_ptr theView3d);
+ virtual
+ Evolution_ptr
+ CreateEvolution(XYPlot_ptr theXYPLot);
+
virtual
void
DeleteResult(Result_ptr theResult);
Engines::TMPFile*
DumpPython(CORBA::Object_ptr theStudy,
CORBA::Boolean theIsPublished,
+ CORBA::Boolean theIsMultiFile,
CORBA::Boolean& theIsValidScript);
// inherited methods from SALOMEDS::Driver
PasteInto(const SALOMEDS::TMPFile& theStream,
CORBA::Long theObjectID,
SALOMEDS::SObject_ptr theObject);
+
+
+ char* getVersion();
+
+ virtual
+ VISU::ColoredPrs3dCache_ptr
+ GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy);
+
+
+ virtual CORBA::Long 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);
+
+ virtual void 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);
+
+ /* Returns clipping plane by its Id */
+ virtual VISU::ClippingPlane* GetClippingPlane(CORBA::Long id);
+
+ /* Deletes clipping plane by its Id */
+ virtual CORBA::Boolean DeleteClippingPlane(CORBA::Long id);
+
+ /* Applyes a clipping plane with Id to presentation thePrs */
+ virtual CORBA::Boolean ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
+
+ /* Detaches a clipping plane with Id from presentation thePrs */
+ virtual CORBA::Boolean DetachClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
+
+ /* Get number of clipping planes */
+ virtual CORBA::Long GetClippingPlanesNb();
+
+ VISU_ClippingPlaneMgr& GetClippingPlaneMgr() { return myClippingPlaneMgr; }
+
+ /* Convert a set of VTK files to the MED file */
+ virtual
+ CORBA::Boolean
+ VTK2MED(const VISU::string_array& theVTKFiles,
+ const char* theMEDFile,
+ const char* theMeshName,
+ const VISU::double_array& theTStamps);
+
+ /* Load texture from file */
+ virtual CORBA::Long LoadTexture(const char* theTextureFile);
+
+ StudyId2MarkerMap& GetMarkerMap() { return myMarkerMap; }
};
}