* This interface is responsible for memory management of 3d presentations.
* One cache corresponds to one study.
*/
- interface ColoredPrs3dCache : PrsObject, SALOME::GenericObj
+ interface ColoredPrs3dCache : RemovableObject, SALOME::GenericObj
{
- /*!
- * This enumeration contains the cache memory modes.
- */
+ /*! This enumeration contains the cache memory modes. */
enum MemoryMode {
MINIMAL, /*!< Minimal memory mode (default behaviour). */
LIMITED /*!< Limited memory mode (fixed memory size for presentations). */
};
- /*!
- * Sets a memory mode.
- */
+ /*! Sets a memory mode.*/
void SetMemoryMode(in MemoryMode theMode);
- /*!
- * Sets a memory size for limited mode.
- */
+ /*! Gets a memory mode.*/
+ MemoryMode GetMemoryMode();
+
+ /*! Sets a memory size for limited mode. */
void SetLimitedMemory(in long theMemorySize);
- /*!
- * Creates %ColoredPrs3dHolder.
- */
+ /*! Gets a memory size for limited mode. */
+ long GetLimitedMemory();
+
+ /*! Creates %ColoredPrs3dHolder.*/
ColoredPrs3dHolder CreateHolder(in VISUType theType,
in ColoredPrs3dHolder::BasicInput theInput);
};
*/
ScalarMap ScalarMapOnField(in Result theResult, in string theMeshName,
in Entity theEntity, in string theFieldName,
- in double theIteration);
+ in long theIteration);
/*!
* Creates a Gauss Points presentation.
*/
GaussPoints GaussPointsOnField(in Result theResult, in string theMeshName,
in Entity theEntity, in string theFieldName,
- in double theIteration);
+ in long theIteration);
/*!
* Creates a deformed shape presentation.
*/
DeformedShape DeformedShapeOnField(in Result theResult, in string theMeshName,
in Entity theEntity, in string theFieldName,
- in double theIteration);
+ in long theIteration);
/*!
* Creates a deformed shape presentation.
*/
ScalarMapOnDeformedShape ScalarMapOnDeformedShapeOnField(in Result theResult, in string theMeshName,
in Entity theEntity, in string theFieldName,
- in double theIteration);
+ in long theIteration);
/*!
* Creates a vector presentation.
*/
Vectors VectorsOnField(in Result theResult, in string theMeshName,
in Entity theEntity, in string theFieldName,
- in double theIteration);
+ in long theIteration);
/*!
* Creates an iso surface presentation.
*/
IsoSurfaces IsoSurfacesOnField(in Result theResult, in string theMeshName,
in Entity theEntity, in string theFieldName,
- in double theIteration);
+ in long theIteration);
/*!
* Creates an stream lines presentation.
*/
StreamLines StreamLinesOnField(in Result theResult, in string theMeshName,
in Entity theEntity, in string theFieldName,
- in double theIteration);
+ in long theIteration);
/*!
* Creates a presentation of cut planes.
*/
CutPlanes CutPlanesOnField(in Result theResult, in string theMeshName,
in Entity theEntity, in string theFieldName,
- in double theIteration);
+ in long theIteration);
/*!
* Creates a presentation of cut lines.
*/
CutLines CutLinesOnField(in Result theResult, in string theMeshName,
in Entity theEntity, in string theFieldName,
- in double theIteration);
+ in long theIteration);
/*!
* Creates a Plot3D presentation.
*/
Plot3D Plot3DOnField(in Result theResult, in string theMeshName,
in Entity theEntity, in string theFieldName,
- in double theIteration);
+ in long theIteration);
/*!
* Creates a table presentation.
}
- ScalarMap_ptr VISU_Gen_i::ScalarMapOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration)
+ ScalarMap_ptr
+ VISU_Gen_i
+ ::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 VISU_Gen_i::GaussPointsOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration)
+ GaussPoints_ptr
+ VISU_Gen_i
+ ::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 VISU_Gen_i::DeformedShapeOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration)
+ DeformedShape_ptr
+ VISU_Gen_i
+ ::DeformedShapeOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->DeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- ScalarMapOnDeformedShape_ptr VISU_Gen_i::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration)
+ ScalarMapOnDeformedShape_ptr
+ VISU_Gen_i
+ ::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->ScalarMapOnDeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration)
+ Vectors_ptr
+ VISU_Gen_i
+ ::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 VISU_Gen_i::IsoSurfacesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration)
+ IsoSurfaces_ptr
+ VISU_Gen_i
+ ::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 VISU_Gen_i::StreamLinesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration)
+ StreamLines_ptr
+ VISU_Gen_i
+ ::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 VISU_Gen_i::CutPlanesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration)
+ CutPlanes_ptr
+ VISU_Gen_i
+ ::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 VISU_Gen_i::CutLinesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration)
+ CutLines_ptr
+ VISU_Gen_i
+ ::CutLinesOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->CutLinesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
- Plot3D_ptr VISU_Gen_i::Plot3DOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration)
+ Plot3D_ptr
+ VISU_Gen_i
+ ::Plot3DOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return myVisuGen->Plot3DOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
}
const char* theGroupName, const char* theNewName);
//Create Presentation Of Results
- virtual ScalarMap_ptr ScalarMapOnField
- (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, CORBA::Double theIteration);
- virtual GaussPoints_ptr GaussPointsOnField
- (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, CORBA::Double theIteration);
- virtual DeformedShape_ptr DeformedShapeOnField
- (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, CORBA::Double theIteration);
- virtual Vectors_ptr VectorsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, CORBA::Double theIteration);
- virtual IsoSurfaces_ptr IsoSurfacesOnField
- (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, CORBA::Double theIteration);
- virtual CutPlanes_ptr CutPlanesOnField
- (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, CORBA::Double theIteration);
- virtual CutLines_ptr CutLinesOnField
- (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, CORBA::Double theIteration);
- virtual StreamLines_ptr StreamLinesOnField
- (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, CORBA::Double theIteration);
- virtual Plot3D_ptr Plot3DOnField (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, CORBA::Double theIteration);
- virtual ScalarMapOnDeformedShape_ptr ScalarMapOnDeformedShapeOnField
- (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, CORBA::Double theIteration);
+ virtual
+ ScalarMap_ptr
+ ScalarMapOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
+
+ virtual
+ GaussPoints_ptr
+ GaussPointsOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
+
+ virtual
+ DeformedShape_ptr
+ DeformedShapeOnField(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::Long theIteration);
+
+ virtual
+ IsoSurfaces_ptr
+ IsoSurfacesOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
+
+ virtual
+ CutPlanes_ptr
+ CutPlanesOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
+
+ virtual
+ CutLines_ptr
+ CutLinesOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
+
+ virtual
+ StreamLines_ptr
+ StreamLinesOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
+
+ virtual
+ Plot3D_ptr
+ Plot3DOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
+
+ virtual
+ ScalarMapOnDeformedShape_ptr
+ ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration);
+
//Create Digital Presentation
virtual Table_ptr CreateTable(const char* theTableEntry);
virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
#include "VisuGUI_TransparencyDlg.h"
#include "VisuGUI_CacheDlg.h"
+#include "VISU_ColoredPrs3dHolder_i.hh"
+
#include "VISU_ScalarMap_i.hh"
#include "VisuGUI_ScalarBarDlg.h"
return;
_PTR(Study) aStudy = GetCStudy( GetAppStudy( theModule ) );
- _PTR(SObject) aSObject = aStudy->FindObjectID( thePrs->GetEntry().latin1() );
+ _PTR(SObject) aSObject = aStudy->FindObjectID( thePrs->GetEntry() );
if ( !theCreate && aSObject ) {
// Remove old Table
}
if ( aCutDlg->isGenerateTable() ) {
- GetVisuGen( theModule )->CreateTable( thePrs->GetEntry() );
+ GetVisuGen( theModule )->CreateTable( thePrs->GetEntry().c_str() );
if ( aCutDlg->isGenerateCurves() ) {
if ( aSObject ) {
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
if( !study )
return prs;
- _PTR(SObject) TableSO = study->studyDS()->FindObjectID( t->GetEntry().latin1() );
+ _PTR(SObject) TableSO = study->studyDS()->FindObjectID( t->GetEntry() );
if( !TableSO )
return prs;
#ifndef VisuGUI_Prs3dTools_HeaderFile
#define VisuGUI_Prs3dTools_HeaderFile
-#include "VISU_Gen_i.hh"
#include "VisuGUI_ViewTools.h"
#include "VisuGUI_DialogRunner.h"
+#include "VISU_ColoredPrs3dFactory.hh"
+#include "VISU_ColoredPrs3dCache_i.hh"
#include <vtkRenderer.h>
ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
VISU::Result_var aResult;
- if (CheckResult(theModule,theTimeStamp,aResult)){
+ if (CheckResult(theModule, theTimeStamp, aResult)){
QApplication::setOverrideCursor(Qt::waitCursor);
- TPrs3d_i* aPrs3d =
- GetVisuGen(theModule)->template CreatePrs3d<TPrs3d_i>
- (aResult,theMeshName,theEntity,theFieldName,theTimeId,thePublishInStudyMode);
+ TPrs3d_i* aPrs3d = NULL;
+ if(thePublishInStudyMode == VISU::ColoredPrs3d_i::EPublishUnderTimeStamp)
+ aPrs3d = VISU::CreatePrs3d<TPrs3d_i>(aResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeId);
+ else
+ aPrs3d = VISU::CreateHolder2GetDeviceByType<TPrs3d_i>(aResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeId);
+
QApplication::restoreOverrideCursor();
if(aPrs3d)
return aPrs3d;
QList<Plot2d_Curve> clist;
aPlot->getCurves( clist );
_PTR(Study) aStudy = GetCStudy( GetAppStudy( theModule ) );
- _PTR(SObject) TableSO = aStudy->FindObjectID( table->GetEntry().latin1() );
+ _PTR(SObject) TableSO = aStudy->FindObjectID( table->GetEntry() );
if ( TableSO ) {
_PTR(ChildIterator) Iter = aStudy->NewChildIterator( TableSO );
for ( ; Iter->More(); Iter->Next() ) {
for ( int i = 0; i < clist.count(); i++ ) {
tmpCurve = dynamic_cast<SPlot2d_Curve*>( clist.at( i ) );
if (tmpCurve && tmpCurve->hasIO() &&
- !strcmp(tmpCurve->getIO()->getEntry(), theCurve->GetEntry())) {
+ theCurve->GetEntry() != tmpCurve->getIO()->getEntry()) {
plotCurve = tmpCurve;
break;
}
for (int i = 0; i < clist.count(); i++) {
tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
if (tmpCurve && tmpCurve->hasIO() &&
- !strcmp(tmpCurve->getIO()->getEntry(), theCurve->GetEntry())) {
+ theCurve->GetEntry() != tmpCurve->getIO()->getEntry()) {
plotCurve = tmpCurve;
} else if (theDisplaying == VISU::eDisplayOnly) {
aPlot->eraseCurve(clist.at(i));
VISU::Curve_i* theCurve = container->GetCurve( k );
if ( theCurve && theCurve->IsValid() ) {
SPlot2d_Curve* plotCurve = dynamic_cast<SPlot2d_Curve*>
- (aView->getCurveByIO(new SALOME_InteractiveObject (theCurve->GetEntry(), "", "")));
+ (aView->getCurveByIO(new SALOME_InteractiveObject(theCurve->GetEntry().c_str(), "", "")));
UpdateCurve( theCurve, aPlot, plotCurve, theDisplaying );
VISU_DumpPython.cc \
VISU_ScalarMapOnDeformedShape_i.cc \
VISU_ColoredPrs3dHolder_i.cc \
- VISU_ColoredPrs3dCache_i.cc
+ VISU_ColoredPrs3dCache_i.cc \
+ VISU_ColoredPrs3dFactory.cc
LIB_MOC = \
VISU_TimeAnimation.h
VISU_TimeAnimation.h \
VISU_ScalarMapOnDeformedShape_i.hh \
VISU_ColoredPrs3dHolder_i.hh \
- VISU_ColoredPrs3dCache_i.hh
+ VISU_ColoredPrs3dCache_i.hh \
+ VISU_ColoredPrs3dFactory.hh
# additionnal information to compil and link file
CPPFLAGS += \
const double theVal);
};
- //===========================================================================
- class RemovableObject_i : public virtual POA_VISU::RemovableObject,
- public virtual Storable
- {
- public:
- virtual void RemoveFromStudy() = 0;
- };
-
//===========================================================================
const CORBA::Boolean IsMultifile();
QString GenerateName(const std::string& theFmt, int theId);
#include "VISU_ColoredPrs3dCache_i.hh"
-#include "VISU_ColoredPrs3d_i.hh"
#include "VISU_ColoredPrs3dHolder_i.hh"
-#include "VISU_Gen_i.hh"
-#include "VISU_Result_i.hh"
+#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_View_i.hh"
#include "VISU_ViewManager_i.hh"
-#include "VISU_ScalarMap_i.hh"
-#include "VISU_IsoSurfaces_i.hh"
-#include "VISU_DeformedShape_i.hh"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
-#include "VISU_GaussPoints_i.hh"
-#include "VISU_Plot3D_i.hh"
-#include "VISU_CutPlanes_i.hh"
-#include "VISU_CutLines_i.hh"
-#include "VISU_Vectors_i.hh"
-#include "VISU_StreamLines_i.hh"
-
-#include "SUIT_ResourceMgr.h"
-
#include "VVTK_ViewWindow.h"
-
-using namespace VISU;
-using namespace std;
+#include "SUIT_ResourceMgr.h"
#ifdef _DEBUG_
static int MYDEBUG = 0;
#endif
//----------------------------------------------------------------------------
-VISU::ColoredPrs3dCache_i::
-ColoredPrs3dCache_i(SALOMEDS::Study_ptr theStudy):
- PrsObject_i(theStudy)
+VISU::ColoredPrs3dCache_i
+::ColoredPrs3dCache_i(SALOMEDS::Study_ptr theStudy):
+ RemovableObject_i()
{
if(MYDEBUG) MESSAGE("ColoredPrs3dCache_i::ColoredPrs3dCache_i - this = "<<this);
+ SetStudyDocument(theStudy);
- QString aComment;
- myName = GetFolderName();
+ SetName(GetFolderName());
CORBA::String_var anIOR = GetID();
SALOMEDS::SComponent_var aSComponent = VISU::FindOrCreateVisuComponent(theStudy);
CORBA::String_var aFatherEntry = aSComponent->GetID();
- CreateAttributes(GetStudyDocument(), aFatherEntry.in(), "", anIOR.in(), myName, "", "", true);
+ CreateAttributes(GetStudyDocument(), aFatherEntry.in(), "", anIOR.in(), GetName(), "", "", true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
//----------------------------------------------------------------------------
-VISU::ColoredPrs3dCache_i::
-~ColoredPrs3dCache_i()
+VISU::ColoredPrs3dCache_i
+::~ColoredPrs3dCache_i()
{
if(MYDEBUG) MESSAGE("ColoredPrs3dCache_i::~ColoredPrs3dCache_i - this = "<<this);
}
+//----------------------------------------------------------------------------
+const string VISU::ColoredPrs3dCache_i::myComment = "COLOREDPRS3DCACHE";
+
+const char*
+VISU::ColoredPrs3dCache_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
+
+
//----------------------------------------------------------------------------
int
-VISU::ColoredPrs3dCache_i::
-IsPossible(VISU::VISUType theType,
- const VISU::ColoredPrs3dHolder::BasicInput& theInput)
+VISU::ColoredPrs3dCache_i
+::IsPossible(VISU::VISUType theType,
+ const VISU::ColoredPrs3dHolder::BasicInput& theInput)
{
//cout << "VISU::ColoredPrs3dCache_i::IsPossible " << endl;
VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>( VISU::GetServant(theInput.myResult).in() );
//----------------------------------------------------------------------------
-void
-VISU::ColoredPrs3dCache_i::
-SetMemoryMode(VISU::ColoredPrs3dCache::MemoryMode theMode)
+VISU::ColoredPrs3dCache_i*
+VISU::ColoredPrs3dCache_i
+::GetInstance_i(SALOMEDS::Study_ptr theStudy)
{
- myMemoryMode = theMode;
- cout << theMode << endl;
+ std::string aFolderName = VISU::ColoredPrs3dCache_i::GetFolderName();
+ SALOMEDS::SObject_var aSObject = theStudy->FindObject(aFolderName.c_str());
+ if(!CORBA::is_nil(aSObject)){
+ CORBA::Object_var anObject = aSObject->GetObject();
+ VISU::ColoredPrs3dCache_var aCache = VISU::ColoredPrs3dCache::_narrow(anObject);
+ if(!CORBA::is_nil(aCache))
+ return dynamic_cast<VISU::ColoredPrs3dCache_i*>(GetServant(aCache).in());
+ }
+
+ return new VISU::ColoredPrs3dCache_i(theStudy);
}
-//----------------------------------------------------------------------------
-void
-VISU::ColoredPrs3dCache_i::
-SetLimitedMemory(CORBA::Long theMemorySize)
+VISU::ColoredPrs3dCache_ptr
+VISU::ColoredPrs3dCache_i
+::GetInstance(SALOMEDS::Study_ptr theStudy)
{
- myLimitedMemory = theMemorySize;
- cout << theMemorySize << endl;
+ VISU::ColoredPrs3dCache_i* aServant = GetInstance_i(theStudy);
+ VISU::ColoredPrs3dCache_var anObject = aServant->_this();
+ return anObject._retn();
}
//----------------------------------------------------------------------------
VISU::ColoredPrs3dHolder_ptr
-VISU::ColoredPrs3dCache_i::
-CreateHolder(VISU::VISUType theType,
- const VISU::ColoredPrs3dHolder::BasicInput& theInput)
+VISU::ColoredPrs3dCache_i
+::CreateHolder(VISU::VISUType theType,
+ const VISU::ColoredPrs3dHolder::BasicInput& theInput)
{
if(IsPossible(theType, theInput))
{
}
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3dCache_i
+::SetMemoryMode(VISU::ColoredPrs3dCache::MemoryMode theMode)
+{
+ myMemoryMode = theMode;
+}
+
+VISU::ColoredPrs3dCache::MemoryMode
+VISU::ColoredPrs3dCache_i
+::GetMemoryMode()
+{
+ return myMemoryMode;
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3dCache_i
+::SetLimitedMemory(CORBA::Long theMemorySize)
+{
+ myLimitedMemory = theMemorySize;
+}
+
+CORBA::Long
+VISU::ColoredPrs3dCache_i
+::GetLimitedMemory()
+{
+ return myLimitedMemory;
+}
+
+
+void
+VISU::ColoredPrs3dCache_i
+::RemoveFromStudy()
+{}
+
+std::string
+VISU::ColoredPrs3dCache_i
+::GetFolderName()
+{
+ return "Cache";
+}
+
+void
+VISU::ColoredPrs3dCache_i
+::ToStream(std::ostringstream&)
+{}
+
+VISU::Storable*
+VISU::ColoredPrs3dCache_i
+::Restore(const Storable::TRestoringMap& theMap)
+{
+ return this;
+}
+
//----------------------------------------------------------------------------
VISU::ColoredPrs3d_i*
-VISU::ColoredPrs3dCache_i::
-CreatePrs(VISU::VISUType theType,
- VISU::ColoredPrs3dHolder::BasicInput theInput,
- VISU::ColoredPrs3dHolder_i* theHolder)
+VISU::
+CreateHolder2GetDeviceByEnum(VISU::VISUType theType,
+ VISU::Result_ptr theResult,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theIteration)
{
- VISU::ColoredPrs3d_i* aPrs3d = Base_i::GetVisuGenImpl()->CreatePrs3d_i(theType, GetStudyDocument());
+ VISU::ColoredPrs3d_i* aColoredPrs3d = NULL;
+ if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
+ VISU::ColoredPrs3dHolder::BasicInput anInput;
+ anInput.myResult = VISU::Result::_duplicate(theResult);
+ anInput.myMeshName = theMeshName.c_str();
+ anInput.myEntity = theEntity;
+ anInput.myFieldName = theFieldName.c_str();
+ anInput.myTimeStampNumber = theIteration;
+
+ SALOMEDS::Study_var aStudy = aResult->GetStudyDocument();
+ VISU::ColoredPrs3dCache_var aCache = ColoredPrs3dCache_i::GetInstance(aStudy);
+ VISU::ColoredPrs3dHolder_var aHolder = aCache->CreateHolder(theType, anInput);
+
+ VISU::ColoredPrs3d_var aPrs3d = aHolder->GetDevice();
+ aColoredPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(GetServant(aPrs3d).in());
+ }
+ return aColoredPrs3d;
+}
+
+
+//----------------------------------------------------------------------------
+VISU::ColoredPrs3d_i*
+VISU::ColoredPrs3dCache_i
+::CreatePrs(VISU::VISUType theType,
+ VISU::ColoredPrs3dHolder::BasicInput theInput,
+ VISU::ColoredPrs3dHolder_i* theHolder)
+{
+ VISU::ColoredPrs3d_i* aPrs3d = VISU::CreatePrs3d_i(theType, GetStudyDocument());
aPrs3d->SetHolderEntry( theHolder->GetEntry() );
aPrs3d->SetResultObject( theInput.myResult );
aPrs3d->SetMeshName( theInput.myMeshName );
//----------------------------------------------------------------------------
-TLastVisitedPrsList&
-VISU::ColoredPrs3dCache_i::
-GetLastVisitedPrsList(VISU::ColoredPrs3dHolder_i* theHolder)
+VISU::TLastVisitedPrsList&
+VISU::ColoredPrs3dCache_i
+::GetLastVisitedPrsList(VISU::ColoredPrs3dHolder_i* theHolder)
{
//cout << "VISU::ColoredPrs3dCache_i::GetLastVisitedPrsList(";
//cout << theHolder->GetEntry().latin1() << ")" << endl;
//----------------------------------------------------------------------------
VISU::ColoredPrs3d_i*
-VISU::ColoredPrs3dCache_i::
-GetLastVisitedPrs(VISU::ColoredPrs3dHolder_i* theHolder)
+VISU::ColoredPrs3dCache_i
+::GetLastVisitedPrs(VISU::ColoredPrs3dHolder_i* theHolder)
{
TLastVisitedPrsList aList = GetLastVisitedPrsList(theHolder);
if( !aList.empty() )
//----------------------------------------------------------------------------
VISU::ColoredPrs3d_i*
-VISU::ColoredPrs3dCache_i::
-FindPrsByInput(TLastVisitedPrsList& theLastVisitedPrsList,
- const VISU::ColoredPrs3dHolder::BasicInput& theInput)
+VISU::ColoredPrs3dCache_i
+::FindPrsByInput(TLastVisitedPrsList& theLastVisitedPrsList,
+ const VISU::ColoredPrs3dHolder::BasicInput& theInput)
{
//cout << "VISU::ColoredPrs3dCache_i::FindPrsByInput() ";
VISU::ColoredPrs3d_i* aPrs3d = NULL;
//----------------------------------------------------------------------------
bool
-VISU::ColoredPrs3dCache_i::
-UpdateLastVisitedPrs(VISU::ColoredPrs3dHolder_i* theHolder,
- VISU::ColoredPrs3d_i* thePrs,
- const VISU::ColoredPrs3dHolder::BasicInput& theInput,
- VISU::View3D_ptr theView3D)
+VISU::ColoredPrs3dCache_i
+::UpdateLastVisitedPrs(VISU::ColoredPrs3dHolder_i* theHolder,
+ VISU::ColoredPrs3d_i* thePrs,
+ const VISU::ColoredPrs3dHolder::BasicInput& theInput,
+ VISU::View3D_ptr theView3D)
{
//cout << "VISU::ColoredPrs3dCache_i::UpdateLastVisitedPrs" << endl;
- VISU::ColoredPrs3d_i* aPrs3d = NULL;
TLastVisitedPrsList& aLastVisitedPrsList = GetLastVisitedPrsList(theHolder);
-
- if(aPrs3d = FindPrsByInput(aLastVisitedPrsList, theInput))
+ VISU::ColoredPrs3d_i* aPrs3d = FindPrsByInput(aLastVisitedPrsList, theInput);
+ if(aPrs3d)
{
aLastVisitedPrsList.pop_front();
}
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
-// File : VISU_ColoredPrs3dCache_i.hxx
+// File : VISU_ColoredPrs3dCache_i.hh
// Author : Oleg UVAROV
// Module : VISU
#include "SALOME_GenericObj_i.hh"
+#include "VISU_ColoredPrs3dFactory.hh"
+
namespace VISU
{
+ class Result_i;
class ColoredPrs3d_i;
class ColoredPrs3dHolder_i;
*/
class ColoredPrs3dCache_i : public virtual POA_VISU::ColoredPrs3dCache,
public virtual SALOME::GenericObj_i,
- public virtual PrsObject_i
+ public virtual RemovableObject_i
{
ColoredPrs3dCache_i();
ColoredPrs3dCache_i(const ColoredPrs3dCache_i&);
~ColoredPrs3dCache_i();
//----------------------------------------------------------------------------
- /*!
- * Sets a memory mode.
- */
- void
- SetMemoryMode(VISU::ColoredPrs3dCache::MemoryMode theMode);
-
- /*!
- * Sets a memory size for limited mode.
- */
- void
- SetLimitedMemory(CORBA::Long theMemorySize);
-
- /*!
- * Creates ColoredPrs3dHolder.
- */
+ /*! Creates ColoredPrs3dHolder */
+ virtual
VISU::ColoredPrs3dHolder_ptr
CreateHolder(VISU::VISUType theType,
const VISU::ColoredPrs3dHolder::BasicInput& theInput);
//----------------------------------------------------------------------------
+ //! Sets a memory mode.
+ virtual
+ void
+ SetMemoryMode(VISU::ColoredPrs3dCache::MemoryMode theMode);
+
+ virtual
VISU::ColoredPrs3dCache::MemoryMode
- GetMemoryMode() const { return myMemoryMode; }
+ GetMemoryMode();
+
+ //----------------------------------------------------------------------------
+ //! Sets a memory size for limited mode.
+ virtual
+ void
+ SetLimitedMemory(CORBA::Long theMemorySize);
- long
- GetLimitedMemory() const { return myLimitedMemory; }
+ virtual
+ CORBA::Long
+ GetLimitedMemory();
+ //----------------------------------------------------------------------------
virtual
VISU::VISUType
- GetType() { return VISU::TCOLOREDPRS3DCACHE; }
+ GetType()
+ {
+ return VISU::TCOLOREDPRS3DCACHE;
+ }
virtual
void
- RemoveFromStudy() {}
+ RemoveFromStudy();
+
+ static
+ std::string
+ GetFolderName();
virtual
- void
- ToStream(std::ostringstream&) {}
+ const char*
+ GetComment() const;
virtual
- const char*
- GetComment() const { return NULL; }
+ void
+ ToStream(std::ostringstream&);
+
+ virtual
+ Storable*
+ Restore(const Storable::TRestoringMap& theMap);
+
+ //----------------------------------------------------------------------------
+ //! Finds or creates instance of the ColoredPrs3dCache in the given SALOMEDS::Study
+ static
+ VISU::ColoredPrs3dCache_i*
+ GetInstance_i(SALOMEDS::Study_ptr theStudy);
static
- const std::string
- GetFolderName() { return "Cache"; }
+ VISU::ColoredPrs3dCache_ptr
+ GetInstance(SALOMEDS::Study_ptr theStudy);
VISU::ColoredPrs3d_i*
CreatePrs(VISU::VISUType theType,
const VISU::ColoredPrs3dHolder::BasicInput& theInput);
private:
+ CORBA::Long myLimitedMemory;
VISU::ColoredPrs3dCache::MemoryMode myMemoryMode;
- long myLimitedMemory;
- TColoredPrs3dHolderMap myHolderMap;
+ TColoredPrs3dHolderMap myHolderMap;
+
+ static const std::string myComment;
};
+
+ //----------------------------------------------------------------------------
+ //! Creates ColoredPrs3dHolder by enumeration value and gets its first device
+ ColoredPrs3d_i*
+ CreateHolder2GetDeviceByEnum(VISU::VISUType theType,
+ VISU::Result_ptr theResult,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theIteration);
+
+
+ //----------------------------------------------------------------------------
+ //! Creates ColoredPrs3dHolder by type and gets its first device
+ template<class TColoredPrs3d_i>
+ TColoredPrs3d_i*
+ CreateHolder2GetDeviceByType(VISU::Result_ptr theResult,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theIteration)
+ {
+ typedef typename TL::TColoredType2Enum<TColoredPrs3d_i>::TResult TEnum;
+ VISU::VISUType aColoredPrs3dType = VISU::VISUType(TEnum::value);
+ ColoredPrs3d_i* aColoredPrs3d = CreateHolder2GetDeviceByEnum(aColoredPrs3dType,
+ theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration);
+ return dynamic_cast<TColoredPrs3d_i*>(aColoredPrs3d);
+ }
+
}
#endif
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File : VISU_ColoredPrs3dCache_i.cc
+// Author : Oleg UVAROV
+// Module : VISU
+
+#include "VISU_ColoredPrs3dFactory.hh"
+
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#define NO_CAS_CATCH
+#endif
+
+#include <Standard_Failure.hxx>
+
+#ifdef NO_CAS_CATCH
+#include <Standard_ErrorHandler.hxx>
+#else
+#include "CASCatch.hxx"
+#endif
+
+#ifdef _DEBUG_
+//static int MYDEBUG = 0;
+//#define _DEXCEPT_
+#else
+//static int MYDEBUG = 0;
+#endif
+
+
+namespace VISU
+{
+ //----------------------------------------------------------------------------
+ bool
+ CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theIteration)
+ {
+#ifndef _DEXCEPT_
+#ifdef NO_CAS_CATCH
+ try{
+ OCC_CATCH_SIGNALS;
+#else
+ CASCatch_TRY{
+ try{
+#endif
+#endif
+ if(theColoredPrs3d->Create(theMeshName, theEntity, theFieldName, theIteration))
+ return true;
+#ifndef _DEXCEPT_
+#ifdef NO_CAS_CATCH
+ }catch(Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
+#else
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
+ }CASCatch_CATCH(Standard_Failure){
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
+ }
+#endif
+#endif
+ return false;
+ }
+
+
+ //----------------------------------------------------------------------------
+ VISU::ColoredPrs3d_i*
+ CreatePrs3d_i(VISUType theType,
+ SALOMEDS::Study_ptr theStudy)
+ {
+ switch(theType){
+ case TSCALARMAP:
+ return VISU::CreatePrs3dByEnum<TSCALARMAP>(theStudy);
+ case TGAUSSPOINTS:
+ return VISU::CreatePrs3dByEnum<TGAUSSPOINTS>(theStudy);
+ case TDEFORMEDSHAPE:
+ return VISU::CreatePrs3dByEnum<TDEFORMEDSHAPE>(theStudy);
+ case TSCALARMAPONDEFORMEDSHAPE:
+ return VISU::CreatePrs3dByEnum<TSCALARMAPONDEFORMEDSHAPE>(theStudy);
+ case TISOSURFACE:
+ return VISU::CreatePrs3dByEnum<TISOSURFACE>(theStudy);
+ case TSTREAMLINES:
+ return VISU::CreatePrs3dByEnum<TSTREAMLINES>(theStudy);
+ case TPLOT3D:
+ return VISU::CreatePrs3dByEnum<TPLOT3D>(theStudy);
+ case TCUTPLANES:
+ return VISU::CreatePrs3dByEnum<TCUTPLANES>(theStudy);
+ case TCUTLINES:
+ return VISU::CreatePrs3dByEnum<TCUTLINES>(theStudy);
+ case TVECTORS:
+ return VISU::CreatePrs3dByEnum<TVECTORS>(theStudy);
+ }
+ return NULL;
+ }
+ //----------------------------------------------------------------------------
+}
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File : VISU_ColoredPrs3dCache_i.hh
+// Author : Oleg UVAROV
+// Module : VISU
+
+#ifndef VISU_ColoredPrs3dFactory_HeaderFile
+#define VISU_ColoredPrs3dFactory_HeaderFile
+
+#include "SALOMEconfig.h"
+#include CORBA_SERVER_HEADER(VISU_Gen)
+#include CORBA_SERVER_HEADER(SALOMEDS)
+
+#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_Plot3D_i.hh"
+#include "VISU_GaussPoints_i.hh"
+#include "VISU_StreamLines_i.hh"
+#include "VISU_Vectors_i.hh"
+#include "VISU_CutLines_i.hh"
+#include "VISU_CutPlanes_i.hh"
+#include "VISU_DeformedShape_i.hh"
+#include "VISU_IsoSurfaces_i.hh"
+#include "VISU_ScalarMap_i.hh"
+#include "VISU_ColoredPrs3d_i.hh"
+#include "VISU_Result_i.hh"
+
+namespace VISU
+{
+ namespace TL
+ {
+ //----------------------------------------------------------------------------
+ template <class T, class U>
+ struct TList
+ {
+ typedef T THead;
+ typedef U TTail;
+ };
+
+ template <int v>
+ struct TInt2Type
+ {
+ enum { value = v };
+ };
+
+ struct TNullType {};
+
+ //----------------------------------------------------------------------------
+ typedef TList<ScalarMapOnDeformedShape_i,
+ TList<DeformedShape_i,
+ TList<StreamLines_i,
+ TList<GaussPoints_i,
+ TList<ScalarMap_i,
+ TList<IsoSurfaces_i,
+ TList<CutPlanes_i,
+ TList<CutLines_i,
+ TList<Vectors_i,
+ TList<Plot3D_i,
+ TNullType> > > > > > > > > >
+ TColoredPrs3dTypeList;
+
+
+ typedef TList<TInt2Type<TSCALARMAPONDEFORMEDSHAPE>,
+ TList<TInt2Type<TDEFORMEDSHAPE>,
+ TList<TInt2Type<TSTREAMLINES>,
+ TList<TInt2Type<TGAUSSPOINTS>,
+ TList<TInt2Type<TSCALARMAP>,
+ TList<TInt2Type<TISOSURFACE>,
+ TList<TInt2Type<TCUTPLANES>,
+ TList<TInt2Type<TCUTLINES>,
+ TList<TInt2Type<TVECTORS>,
+ TList<TInt2Type<TPLOT3D>,
+ TNullType> > > > > > > > > >
+ TColoredPrs3dEnumList;
+
+
+ //----------------------------------------------------------------------------
+ template <class TypeList, unsigned int index>
+ struct TTypeAt;
+
+ template <class THead, class TTail>
+ struct TTypeAt<TList<THead, TTail>, 0>
+ {
+ typedef THead TResult;
+ };
+
+
+ template <class THead, class TTail, unsigned int index>
+ struct TTypeAt<TList<THead, TTail>, index>
+ {
+ typedef typename TTypeAt<TTail, index - 1>::TResult TResult;
+ };
+
+ //----------------------------------------------------------------------------
+ template <class TypeList, class T>
+ struct TIndexOf;
+
+ template <class T>
+ struct TIndexOf<TNullType, T>
+ {
+ enum { value = -1 };
+ };
+
+ template <class T, class TTail>
+ struct TIndexOf<TList<T, TTail>, T>
+ {
+ enum { value = 0 };
+ };
+
+ template <class THead, class TTail, class T>
+ struct TIndexOf<TList<THead, TTail>, T>
+ {
+ private:
+ enum { temp = TIndexOf<TTail, T>::value };
+ public:
+ enum { value = temp == -1? -1 : 1 + temp };
+ };
+
+ //----------------------------------------------------------------------------
+ template <unsigned int type_enum>
+ struct TColoredEnum2Type
+ {
+ typedef typename TTypeAt<TColoredPrs3dTypeList, TIndexOf<TColoredPrs3dEnumList, TInt2Type<type_enum> >::value >::TResult TResult;
+ };
+
+ //----------------------------------------------------------------------------
+ template <class T>
+ struct TColoredType2Enum
+ {
+ typedef typename TTypeAt<TColoredPrs3dEnumList, TIndexOf<TColoredPrs3dTypeList, T>::value >::TResult TResult;
+ };
+
+ }
+
+ //----------------------------------------------------------------------------
+ template<typename TPrs3d_i>
+ ColoredPrs3d_i*
+ CreatePrs3dByType(SALOMEDS::Study_ptr theStudy)
+ {
+ if(!theStudy->GetProperties()->IsLocked()){
+ typedef typename TPrs3d_i::TInterface TPrs3d;
+ if(TPrs3d_i* aPresent = new TPrs3d_i(NULL,ColoredPrs3d_i::EPublishIndependently)){
+ return aPresent;
+ }
+ }
+ return NULL;
+ }
+
+
+ //----------------------------------------------------------------------------
+ template<unsigned int type_enum>
+ ColoredPrs3d_i*
+ CreatePrs3dByEnum(SALOMEDS::Study_ptr theStudy)
+ {
+ typedef typename TL::TColoredEnum2Type<type_enum>::TResult TColoredPrs3d;
+ return CreatePrs3dByType<TColoredPrs3d>(theStudy);
+ };
+
+
+ //----------------------------------------------------------------------------
+ ColoredPrs3d_i*
+ CreatePrs3d_i(VISUType theType,
+ SALOMEDS::Study_ptr theStudy);
+
+
+ //----------------------------------------------------------------------------
+ bool
+ CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theIteration);
+
+
+ //----------------------------------------------------------------------------
+ //Create 3D collored Presentation Of Different Types
+ template<typename TPrs3d_i> TPrs3d_i*
+ CreatePrs3d(Result_ptr theResult,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theIteration)
+ {
+ typedef typename TPrs3d_i::TInterface TPrs3d;
+ typename TPrs3d::_var_type aPrs3d;
+
+ if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
+ SALOMEDS::Study_var aStudy = aResult->GetStudyDocument();
+ if(aStudy->GetProperties()->IsLocked())
+ return NULL;
+
+ if(TPrs3d_i::IsPossible(aResult, theMeshName, theEntity, theFieldName, theIteration)){
+ TPrs3d_i* aPresent = new TPrs3d_i(aResult);
+
+ 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 std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theIteration)
+ {
+ typedef typename TPrs3d_i::TInterface TPrs3d;
+ typename TPrs3d::_var_type aPrs3d;
+ if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration))
+ return aPrs3d->_this();
+ return TPrs3d::_nil();
+ }
+ //----------------------------------------------------------------------------
+}
+
+#endif
//---------------------------------------------------------------
QString
-VISU::ColoredPrs3dHolder_i::
-GenerateName()
+VISU::ColoredPrs3dHolder_i
+::GenerateName()
{
return VISU::GenerateName("Holder",myNbHolders++);
}
//----------------------------------------------------------------------------
-VISU::ColoredPrs3dHolder_i::
-ColoredPrs3dHolder_i(VISU::VISUType theType,
- VISU::ColoredPrs3dHolder::BasicInput theInput,
- VISU::ColoredPrs3dCache_i& theCache) :
+const string VISU::ColoredPrs3dHolder_i::myComment = "COLOREDPRS3DHOLDER";
+
+const char*
+VISU::ColoredPrs3dHolder_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
+
+
+//----------------------------------------------------------------------------
+VISU::ColoredPrs3dHolder_i
+::ColoredPrs3dHolder_i(VISU::VISUType theType,
+ VISU::ColoredPrs3dHolder::BasicInput theInput,
+ VISU::ColoredPrs3dCache_i& theCache) :
PrsObject_i(theCache.GetStudyDocument()),
- myPrsType(theType),
myCache(theCache)
{
if(MYDEBUG) MESSAGE("ColoredPrs3dHolder_i::ColoredPrs3dHolder_i - this = "<<this);
}
QString aComment;
- myName = GenerateName().latin1();
+ SetName(GenerateName().latin1());
CORBA::String_var anIOR = GetID();
std::string aFatherEntry = theCache.GetEntry();
aComment = QString("myComment=") + aType;
- CreateAttributes(GetStudyDocument(), aFatherEntry, "", anIOR.in(), myName, "", aComment, true);
+ CreateAttributes(GetStudyDocument(), aFatherEntry, "", anIOR.in(), GetName(), "", aComment, true);
}
//----------------------------------------------------------------------------
-VISU::ColoredPrs3dHolder_i::
-~ColoredPrs3dHolder_i()
+VISU::ColoredPrs3dHolder_i
+::~ColoredPrs3dHolder_i()
{
if(MYDEBUG) MESSAGE("ColoredPrs3dHolder_i::~ColoredPrs3dHolder_i - this = "<<this);
}
//----------------------------------------------------------------------------
CORBA::Boolean
-VISU::ColoredPrs3dHolder_i::
-Apply(VISU::ColoredPrs3d_ptr thePrs3d,
- const VISU::ColoredPrs3dHolder::BasicInput& theInput,
- VISU::View3D_ptr theView3D)
+VISU::ColoredPrs3dHolder_i
+::Apply(VISU::ColoredPrs3d_ptr thePrs3d,
+ const VISU::ColoredPrs3dHolder::BasicInput& theInput,
+ VISU::View3D_ptr theView3D)
{
VISU::ColoredPrs3d_i* aPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>( VISU::GetServant(thePrs3d).in() );
return myCache.UpdateLastVisitedPrs(this, aPrs3d, theInput, theView3D);
}
//----------------------------------------------------------------------------
-VISU::ColoredPrs3d_ptr
-VISU::ColoredPrs3dHolder_i::
-GetDevice()
+VISU::ColoredPrs3d_i*
+VISU::ColoredPrs3dHolder_i
+::GetPrs3dDevice()
{
- if(VISU::ColoredPrs3d_i* aPrs3d = myCache.GetLastVisitedPrs(this))
- return aPrs3d->_this();
+ return myCache.GetLastVisitedPrs(this);
+}
+
- return VISU::ColoredPrs3d::_nil();
+VISU::ColoredPrs3d_ptr
+VISU::ColoredPrs3dHolder_i
+::GetDevice()
+{
+ return GetPrs3dDevice()->_this();
}
//----------------------------------------------------------------------------
VISU::ColoredPrs3d::TimeStampsRange*
-VISU::ColoredPrs3dHolder_i::
-GetTimeStampsRange()
+VISU::ColoredPrs3dHolder_i
+::GetTimeStampsRange()
{
if( VISU::ColoredPrs3d_ptr aDevice = GetDevice() )
return aDevice->GetTimeStampsRange();
//----------------------------------------------------------------------------
VISU::ColoredPrs3dHolder::BasicInput*
-VISU::ColoredPrs3dHolder_i::
-GetBasicInput()
+VISU::ColoredPrs3dHolder_i
+::GetBasicInput()
{
if( VISU::ColoredPrs3d_ptr aDevice = GetDevice() )
{
return NULL;
}
+
+
+//----------------------------------------------------------------------------
+VISU::VISUType
+VISU::ColoredPrs3dHolder_i
+::GetPrsType()
+{
+ return GetPrs3dDevice()->GetType();
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3dHolder_i
+::RemoveFromStudy()
+{}
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3dHolder_i
+::ToStream(std::ostringstream&)
+{}
+
+//----------------------------------------------------------------------------
+VISU::Storable*
+VISU::ColoredPrs3dHolder_i
+::Restore(const Storable::TRestoringMap& theMap)
+{
+ return this;
+}
+
~ColoredPrs3dHolder_i();
//----------------------------------------------------------------------------
- /*! Apply input parameters to last visited presentation in the cache.
- */
+ //! Apply input parameters to last visited presentation in the cache.
virtual
CORBA::Boolean
Apply(VISU::ColoredPrs3d_ptr thePrs3d,
const VISU::ColoredPrs3dHolder::BasicInput& theInput,
VISU::View3D_ptr theView3D);
- /*! Gets the last visited presentation in the cache.
- */
+ //----------------------------------------------------------------------------
+ //! Gets the last visited presentation in the cache.
+ VISU::ColoredPrs3d_i*
+ GetPrs3dDevice();
+
+ //! Gets the last visited presentation in the cache.
virtual
VISU::ColoredPrs3d_ptr
GetDevice();
- /*! Gets TimeStampsRange information from the last visited presentation.
- */
+ //----------------------------------------------------------------------------
+ //! Gets TimeStampsRange information from the last visited presentation.
virtual
VISU::ColoredPrs3d::TimeStampsRange*
GetTimeStampsRange();
- /*! Gats input parameters of the last visited presentation.
- */
+ //! Gats input parameters of the last visited presentation.
VISU::ColoredPrs3dHolder::BasicInput*
GetBasicInput();
//----------------------------------------------------------------------------
virtual
VISU::VISUType
- GetType() { return VISU::TCOLOREDPRS3DHOLDER; }
+ GetType()
+ {
+ return VISU::TCOLOREDPRS3DHOLDER;
+ }
+
+ VISU::VISUType
+ GetPrsType();
+ //----------------------------------------------------------------------------
virtual
void
- RemoveFromStudy() {}
+ RemoveFromStudy();
+
+ virtual
+ const char*
+ GetComment() const;
virtual
void
- ToStream(std::ostringstream&) {}
+ ToStream(std::ostringstream&);
+
+ virtual
+ Storable*
+ Restore(const Storable::TRestoringMap& theMap);
virtual
QString
GenerateName();
- virtual
- const char*
- GetComment() const { return NULL; }
-
//----------------------------------------------------------------------------
- VISU::VISUType
- GetPrsType() const { return myPrsType; }
-
private:
- VISU::VISUType myPrsType;
-
- VISU::ColoredPrs3dCache_i& myCache;
-
- static int myNbHolders;
+ VISU::ColoredPrs3dCache_i& myCache;
+ static const std::string myComment;
+ static int myNbHolders;
};
}
return aBasicInput;
}
-QString
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetHolderEntry(const std::string& theEntry)
+{
+ myHolderEntry = theEntry;
+}
+
+std::string
VISU::ColoredPrs3d_i
::GetEntry()
{
- if( !myHolderEntry.isEmpty() )
+ if(myHolderEntry != "")
return myHolderEntry;
return TSuperClass::GetEntry();
try{
#endif
QString aComment;
- myName = "NoName";
+ SetName("NoName");
if(theBuildMode == ECreateNew || theBuildMode == ESameAs){
if(!IsRangeFixed())
SetSourceRange();
SetTitle(GetCFieldName().c_str());
}
if(myPublishInStudyMode == EPublishUnderTimeStamp){
- myName = GenerateName().latin1();
+ SetName(GenerateName().latin1());
aComment.sprintf("myComment=TIMESTAMP;myType=%d;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
VISU::TTIMESTAMP,
GetCMeshName().c_str(),
anEntry,
aRefFatherEntry,
anIOR.in(),
- myName,
+ GetName(),
"",
aComment.latin1(),
true);
SetSObject(GetStudyDocument()->FindObjectIOR(anIOR));
}else if(myPublishInStudyMode == EPublishIndependently){
- myName = GenerateName().latin1();
+ SetName(GenerateName().latin1());
CORBA::String_var anIOR = GetID();
std::string aFatherEntry = VISU::FindOrCreate3DPresentationsFolder(GetStudyDocument());
aComment.sprintf("myComment=%s",
aFatherEntry,
"",
anIOR.in(),
- myName,
+ GetName(),
"",
aComment.latin1(),
true);
virtual
void
- SetHolderEntry( const QString& theEntry ) { myHolderEntry = theEntry; }
+ SetHolderEntry(const std::string& theEntry);
virtual
- QString
+ std::string
GetEntry();
+
//----------------------------------------------------------------------------
public:
/*!
PField myField;
EPublishInStudyMode myPublishInStudyMode;
- QString myHolderEntry;
+ std::string myHolderEntry;
std::string myTitle;
std::string myScalarBarTitle;
#include "VISU_Prs3d_i.hh"
#include "VISU_Mesh_i.hh"
-#include "VISU_ScalarMap_i.hh"
-#include "VISU_IsoSurfaces_i.hh"
-#include "VISU_DeformedShape_i.hh"
-#include "VISU_CutPlanes_i.hh"
-#include "VISU_CutLines_i.hh"
-#include "VISU_Vectors_i.hh"
-#include "VISU_StreamLines_i.hh"
-#include "VISU_GaussPoints_i.hh"
-#include "VISU_Plot3D_i.hh"
#include "VISU_Table_i.hh"
#include "VISU_TimeAnimation.h"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_ColoredPrs3dCache_i.hh"
#include "VISU_ColoredPrs3dHolder_i.hh"
#include <TCollection_AsciiString.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
-// STL Includes
-#include <strstream>
-
#include "Utils_ExceptHandlers.hxx"
+UNEXPECT_CATCH(SalomeException, SALOME::SALOME_Exception);
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
-#define NO_CAS_CATCH
-#endif
-
-#include <Standard_Failure.hxx>
-
-#ifdef NO_CAS_CATCH
-#include <Standard_ErrorHandler.hxx>
-#else
-#include "CASCatch.hxx"
-#endif
+// STL Includes
+#include <strstream>
using namespace std;
#ifdef _DEBUG_
static int MYDEBUG = 0;
-//#define _DEXCEPT_
#else
static int MYDEBUG = 0;
#endif
-UNEXPECT_CATCH(SalomeException, SALOME::SALOME_Exception);
-
-extern "C" VISU::VISU_Gen_ptr GetImpl(CORBA::ORB_ptr theORB,
- PortableServer::POA_ptr thePOA,
- SALOME_NamingService* theNamingService,
- QMutex* theMutex)
+extern "C"
+VISU::VISU_Gen_ptr
+GetImpl(CORBA::ORB_ptr theORB,
+ PortableServer::POA_ptr thePOA,
+ SALOME_NamingService* theNamingService,
+ QMutex* theMutex)
{
- if(MYDEBUG) MESSAGE("extern \"C\" GetImpl");
+ if(MYDEBUG) MESSAGE("extern 'C' GetImpl");
VISU::VISU_Gen_i *aVISU_Gen = new VISU::VISU_Gen_i(theORB,thePOA,theNamingService,theMutex);
//return VISU::VISU_Gen::_duplicate(aVISU_Gen->_this());
return aVISU_Gen->_this();
namespace VISU
{
+ //----------------------------------------------------------------------------
static string VisuTmpDir;
static CORBA::Boolean myIsMultiFile;
const CORBA::Boolean IsMultifile() { return myIsMultiFile;}
- //===========================================================================
- _PTR(SComponent) ClientFindOrCreateVisuComponent (_PTR(Study) theStudyDocument)
+ //----------------------------------------------------------------------------
+ _PTR(SComponent)
+ ClientFindOrCreateVisuComponent (_PTR(Study) theStudyDocument)
{
_PTR(SComponent) aSComponent = theStudyDocument->FindComponent("VISU");
if (!aSComponent) {
return aSComponent;
}
- SALOMEDS::SComponent_var FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument){
+
+ //----------------------------------------------------------------------------
+ SALOMEDS::SComponent_var
+ FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument)
+ {
SALOMEDS::SComponent_var aSComponent = theStudyDocument->FindComponent("VISU");
if (aSComponent->_is_nil()) {
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudyDocument->NewBuilder();
return aSComponent;
}
- void RegistryStorable() {
+
+ //----------------------------------------------------------------------------
+ void
+ RegistryStorable()
+ {
Storable::Registry(Result_i::myComment.c_str(),&(Result_i::Restore));
Storable::Registry(Mesh_i::myComment.c_str(),&(Restore<Mesh_i>));
Storable::Registry(ScalarMap_i::myComment.c_str(),&(Restore<ScalarMap_i>));
}
- //===========================================================================
- VISU_Gen_i::
- VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA,
- SALOME_NamingService* theNamingService, QMutex* theMutex) :
+ //----------------------------------------------------------------------------
+ VISU_Gen_i
+ ::VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA,
+ SALOME_NamingService* theNamingService, QMutex* theMutex) :
Engines_Component_i()
{
if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : "<<theMutex);
}
- ColoredPrs3d_i*
- VISU_Gen_i::
- CreatePrs3d_i(VISUType theType,
- SALOMEDS::Study_ptr theStudy)
- {
- switch(theType){
- case TSCALARMAP:
- return VISU::CreatePrs3d_i<ScalarMap_i>(theStudy);
- case TGAUSSPOINTS:
- return VISU::CreatePrs3d_i<GaussPoints_i>(theStudy);
- case TDEFORMEDSHAPE:
- return VISU::CreatePrs3d_i<DeformedShape_i>(theStudy);
- case TSCALARMAPONDEFORMEDSHAPE:
- return VISU::CreatePrs3d_i<ScalarMapOnDeformedShape_i>(theStudy);
- case TISOSURFACE:
- return VISU::CreatePrs3d_i<IsoSurfaces_i>(theStudy);
- case TSTREAMLINES:
- return VISU::CreatePrs3d_i<StreamLines_i>(theStudy);
- case TPLOT3D:
- return VISU::CreatePrs3d_i<Plot3D_i>(theStudy);
- case TCUTPLANES:
- return VISU::CreatePrs3d_i<CutPlanes_i>(theStudy);
- case TCUTLINES:
- return VISU::CreatePrs3d_i<CutLines_i>(theStudy);
- case TVECTORS:
- return VISU::CreatePrs3d_i<Vectors_i>(theStudy);
- }
- return NULL;
- }
-
-
+ //----------------------------------------------------------------------------
Prs3d_ptr
- VISU_Gen_i::
- CreatePrs3d(VISUType theType,
- SALOMEDS::Study_ptr theStudy)
+ VISU_Gen_i
+ ::CreatePrs3d(VISUType theType,
+ SALOMEDS::Study_ptr theStudy)
{
- if(ColoredPrs3d_i* aPrs3d = CreatePrs3d_i(theType, theStudy))
+ if(ColoredPrs3d_i* aPrs3d = VISU::CreatePrs3d_i(theType, theStudy))
return aPrs3d->_this();
return Prs3d::_nil();
}
- bool
- CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
- const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Double theIteration)
+ //----------------------------------------------------------------------------
+ VISU_Gen_i
+ ::~VISU_Gen_i()
{
-#ifndef _DEXCEPT_
-#ifdef NO_CAS_CATCH
- try{
- OCC_CATCH_SIGNALS;
-#else
- CASCatch_TRY{
- try{
-#endif
-#endif
- if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration)))
- return true;
-#ifndef _DEXCEPT_
-#ifdef NO_CAS_CATCH
- }catch(Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!");
- }
-#else
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!");
- }
- }CASCatch_CATCH(Standard_Failure){
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
- }
-#endif
-#endif
- return false;
- }
-
- VISU_Gen_i::~VISU_Gen_i(){
if(MYDEBUG) MESSAGE("VISU_Gen_i::~VISU_Gen_i");
}
- void CorrectSObjectType(SALOMEDS::SObject_ptr theSObject)
+
+ //----------------------------------------------------------------------------
+ void
+ CorrectSObjectType(SALOMEDS::SObject_ptr theSObject)
{
SALOMEDS::GenericAttribute_var anAttr;
if ( theSObject->FindAttribute(anAttr, "AttributeComment") ) {
}
}
- //===========================================================================
- CORBA::Boolean VISU_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
- const SALOMEDS::TMPFile & theStream,
- const char* theURL,
- bool isMultiFile)
+
+ //----------------------------------------------------------------------------
+ CORBA::Boolean
+ VISU_Gen_i
+ ::Load(SALOMEDS::SComponent_ptr theComponent,
+ const SALOMEDS::TMPFile & theStream,
+ const char* theURL,
+ bool isMultiFile)
{
Mutex mt(myMutex);
SALOMEDS::Study_var aStudy = theComponent->GetStudy();
return true;
}
- CORBA::Boolean VISU_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
- const SALOMEDS::TMPFile & theStream,
- const char* theURL,
- bool isMultiFile)
+
+ //----------------------------------------------------------------------------
+ CORBA::Boolean
+ VISU_Gen_i
+ ::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
+ 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)
+
+ //----------------------------------------------------------------------------
+ char*
+ VISU_Gen_i
+ ::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
+ const char* aLocalPersistentID,
+ CORBA::Boolean isMultiFile,
+ CORBA::Boolean isASCII)
{
CORBA::String_var aString("");
if(strcmp(aLocalPersistentID,"") != 0) {
return aString._retn();
}
- //===========================================================================
- SALOMEDS::TMPFile* VISU_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
- const char* theURL,
- bool theIsMultiFile)
+
+ //----------------------------------------------------------------------------
+ SALOMEDS::TMPFile*
+ VISU_Gen_i
+ ::Save(SALOMEDS::SComponent_ptr theComponent,
+ const char* theURL,
+ bool theIsMultiFile)
{
Mutex mt(myMutex);
string aTmpDir = theURL;
return aStreamFile._retn();
}
- SALOMEDS::TMPFile* VISU_Gen_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
- const char* theURL,
- bool isMultiFile)
+
+ //----------------------------------------------------------------------------
+ SALOMEDS::TMPFile*
+ VISU_Gen_i
+ ::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
+ const char* theURL,
+ bool isMultiFile)
{
Mutex mt(myMutex);
string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
return aStreamFile._retn();
}
- char* VISU_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
- const char* IORString,
- CORBA::Boolean isMultiFile,
- CORBA::Boolean isASCII)
+
+ //----------------------------------------------------------------------------
+ char*
+ VISU_Gen_i
+ ::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
+ const char* IORString,
+ CORBA::Boolean isMultiFile,
+ CORBA::Boolean isASCII)
{
CORBA::String_var aString(IORString);
if(strcmp(IORString,"") != 0){
return aString._retn();
}
- char* VISU_Gen_i::GetID(){
+
+ //----------------------------------------------------------------------------
+ char*
+ VISU_Gen_i
+ ::GetID()
+ {
return Base_i::GetID();
}
- void VISU_Gen_i::SetCurrentStudy (SALOMEDS::Study_ptr theStudy)
+
+ //----------------------------------------------------------------------------
+ void
+ VISU_Gen_i
+ ::SetCurrentStudy(SALOMEDS::Study_ptr theStudy)
{
class TEvent: public SALOME_Event {
std::string myStudyName;
}
}
- SALOMEDS::Study_ptr VISU_Gen_i::GetCurrentStudy(){
+
+ //----------------------------------------------------------------------------
+ SALOMEDS::Study_ptr
+ VISU_Gen_i
+ ::GetCurrentStudy()
+ {
return SALOMEDS::Study::_duplicate(myStudyDocument);
}
- ViewManager_ptr VISU_Gen_i::GetViewManager(){
+
+ //----------------------------------------------------------------------------
+ ViewManager_ptr
+ VISU_Gen_i
+ ::GetViewManager()
+ {
Mutex mt(myMutex);
ViewManager_i * aViewManager = new ViewManager_i(myStudyDocument);
return ViewManager::_duplicate(aViewManager->_this());
}
- SALOMEDS::SObject_ptr VISU_Gen_i::ImportTables(const char* theFileName){
+
+ //----------------------------------------------------------------------------
+ SALOMEDS::SObject_ptr
+ VISU_Gen_i
+ ::ImportTables(const char* theFileName)
+ {
if(myStudyDocument->GetProperties()->IsLocked())
return SALOMEDS::SObject::_nil();
Mutex mt(myMutex);
return aRes._retn();
}
- CORBA::Boolean VISU_Gen_i::ExportTableToFile(SALOMEDS::SObject_ptr theTable,
- const char* theFileName)
+
+ //----------------------------------------------------------------------------
+ CORBA::Boolean
+ VISU_Gen_i
+ ::ExportTableToFile(SALOMEDS::SObject_ptr theTable,
+ const char* theFileName)
{
return VISU::ExportTableToFile(theTable, theFileName);
}
- Result_ptr VISU_Gen_i::ImportFile(const char* theFileName){
+
+ //----------------------------------------------------------------------------
+ Result_ptr
+ VISU_Gen_i
+ ::ImportFile(const char* theFileName)
+ {
if(myStudyDocument->GetProperties()->IsLocked())
return Result::_nil();
Mutex mt(myMutex);
}
}
- Result_ptr VISU_Gen_i::CreateResult(const char* theFileName){
+
+ //----------------------------------------------------------------------------
+ Result_ptr
+ VISU_Gen_i
+ ::CreateResult(const char* theFileName)
+ {
if(myStudyDocument->GetProperties()->IsLocked())
return Result::_nil();
Mutex mt(myMutex);
}
}
- Result_ptr VISU_Gen_i::CopyAndImportFile(const char* theFileName){
+
+ //----------------------------------------------------------------------------
+ Result_ptr
+ VISU_Gen_i
+ ::CopyAndImportFile(const char* theFileName)
+ {
if(myStudyDocument->GetProperties()->IsLocked())
return Result::_nil();
Mutex mt(myMutex);
return aResult._retn();
}
- Result_ptr VISU_Gen_i::ImportMed (SALOMEDS::SObject_ptr theMedSObject)
+
+ //----------------------------------------------------------------------------
+ Result_ptr
+ VISU_Gen_i
+ ::ImportMed(SALOMEDS::SObject_ptr theMedSObject)
{
if (myStudyDocument->GetProperties()->IsLocked())
return Result::_nil();
}
}
- Result_ptr VISU_Gen_i::ImportMedField (SALOME_MED::FIELD_ptr theField)
+
+ //----------------------------------------------------------------------------
+ Result_ptr
+ VISU_Gen_i
+ ::ImportMedField (SALOME_MED::FIELD_ptr theField)
{
if (myStudyDocument->GetProperties()->IsLocked())
return Result::_nil();
}
}
- void VISU_Gen_i::RenameMeshInStudy(Result_ptr theResult,
- string theMeshName,
- int theEntity, // -1 for group indication
- string theSubMeshName, // Family or Group name
- string theNewName)
+ 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)
{
if (myStudyDocument->GetProperties()->IsLocked()) return;
Mutex mt(myMutex);
aStudyBuilder->CommitCommand();
}
- 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)
{
RenameMeshInStudy(theResult, theMeshName, (int)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)
{
RenameMeshInStudy(theResult, theMeshName, (int)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)
{
RenameMeshInStudy(theResult, theMeshName, -1, theGroupName, theNewName);
}
- 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)
{
if(myStudyDocument->GetProperties()->IsLocked())
return Mesh::_nil();
return VISU::Mesh::_nil();
}
- 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)
{
if(myStudyDocument->GetProperties()->IsLocked())
return Mesh::_nil();
return VISU::Mesh::_nil();
}
- 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)
{
if(myStudyDocument->GetProperties()->IsLocked())
return Mesh::_nil();
return VISU::Mesh::_nil();
}
- ScalarMap_ptr VISU_Gen_i::ScalarMapOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration)
+
+ //----------------------------------------------------------------------------
+ ScalarMap_ptr
+ VISU_Gen_i
+ ::ScalarMapOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
- return Prs3dOnField<VISU::ScalarMap_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
+ return Prs3dOnField<VISU::ScalarMap_i>(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
- GaussPoints_ptr VISU_Gen_i::GaussPointsOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration)
+
+ //----------------------------------------------------------------------------
+ GaussPoints_ptr
+ VISU_Gen_i
+ ::GaussPointsOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::GaussPoints_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
}
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration)
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::DeformedShape_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
}
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration)
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::ScalarMapOnDeformedShape_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
}
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration)
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::Vectors_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
}
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration)
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::IsoSurfaces_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
}
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration)
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::StreamLines_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
}
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration)
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::Plot3D_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
}
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration)
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::CutPlanes_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
}
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration)
+ CORBA::Long theIteration)
{
return Prs3dOnField<VISU::CutLines_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
}
// Assign an ID = 1 the the type VISU::Result
theObjectID = 1;
-
SALOMEDS::SComponent_var aSComponent = theObject->GetStudy()->FindComponent("VISU");
return aStreamFile._retn();
}
return aResultSO._retn();
}
- VISU::ColoredPrs3d_i*
- VISU_Gen_i::
- CreateHolder(VISU::VISUType theType,
- Result_i* theResult,
- const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Double theIteration)
- {
- VISU::ColoredPrs3dHolder::BasicInput anInput;
- anInput.myResult = theResult->_this();
- anInput.myMeshName = theMeshName.c_str();
- anInput.myEntity = theEntity;
- anInput.myFieldName = theFieldName.c_str();
- anInput.myTimeStampNumber = theIteration;
-
- SALOMEDS::Study_var aStudy = GetCurrentStudy();
- VISU::ColoredPrs3dCache_ptr aCache = GetColoredPrs3dCache(aStudy);
- VISU::ColoredPrs3dHolder_ptr aHolder = aCache->CreateHolder(theType,anInput);
-
- VISU::ColoredPrs3d_ptr aPrs3d = aHolder->GetDevice();
- VISU::ColoredPrs3d_i* aPrs3d_i = dynamic_cast<VISU::ColoredPrs3d_i*>(GetServant(aPrs3d).in());
-
- return aPrs3d_i;
- }
-
VISU::ColoredPrs3dCache_ptr
VISU_Gen_i::
GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy)
{
- SALOMEDS::SObject_var aSObject = theStudy->FindObject(VISU::ColoredPrs3dCache_i::GetFolderName().c_str());
- if(!CORBA::is_nil(aSObject))
- {
- CORBA::Object_var anObject = aSObject->GetObject();
- VISU::ColoredPrs3dCache_var aCache = VISU::ColoredPrs3dCache::_narrow(anObject);
- if(!CORBA::is_nil(aCache))
- return aCache._retn();
- }
-
- return (new VISU::ColoredPrs3dCache_i(theStudy))->_this();
+ return ColoredPrs3dCache_i::GetInstance(theStudy);
}
}
namespace VISU
{
- class Result_i;
- class ColoredPrs3d_i;
- class ColoredPrs3dCache_i;
- class ColoredPrs3dHolder_i;
-
- bool
- CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
- const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Double theIteration);
-
- template<typename TPrs3d_i>
- ColoredPrs3d_i*
- CreatePrs3d_i(SALOMEDS::Study_ptr theStudy)
- {
- if(!theStudy->GetProperties()->IsLocked()){
- typedef typename TPrs3d_i::TInterface TPrs3d;
- if(TPrs3d_i* aPresent = new TPrs3d_i(NULL,ColoredPrs3d_i::EPublishIndependently)){
- return aPresent;
- }
- }
- return NULL;
- }
-
+ //----------------------------------------------------------------------------
class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
public virtual ::Engines_Component_i,
public virtual Base_i
PortableServer::POA_ptr thePOA,
SALOME_NamingService* theNamingService,
QMutex* theMutex);
- virtual ~VISU_Gen_i();
+
+ virtual
+ ~VISU_Gen_i();
virtual
char*
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,
const char* theMeshName,
const char* theGroupName);
- ColoredPrs3d_i*
- CreatePrs3d_i(VISUType theType,
- SALOMEDS::Study_ptr theStudy);
-
Prs3d_ptr
CreatePrs3d(VISUType theType,
SALOMEDS::Study_ptr theStudy);
- ColoredPrs3d_i*
- CreateHolder(VISU::VISUType theType,
- Result_i* theResult,
- const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Double theIteration);
-
- //Create 3D collored Presentation Of Different Types
- template<typename TPrs3d_i> TPrs3d_i*
- CreatePrs3d(Result_ptr theResult,
- const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Double theIteration,
- ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode = ColoredPrs3d_i::EPublishUnderTimeStamp)
- {
- 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,thePublishInStudyMode);
-
- if( thePublishInStudyMode != ColoredPrs3d_i::EPublishUnderTimeStamp )
- {
- ColoredPrs3d_i* aPrs3d =
- CreateHolder(aPresent->GetType(),aResult,theMeshName,theEntity,theFieldName,theIteration);
-
- return dynamic_cast<TPrs3d_i*>(aPrs3d);
- }
-
- 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 std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Double theIteration)
- {
- typedef typename TPrs3d_i::TInterface TPrs3d;
- typename TPrs3d::_var_type aPrs3d;
- if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,theMeshName,theEntity,theFieldName,theIteration))
- return aPrs3d->_this();
- return TPrs3d::_nil();
- }
-
virtual
ScalarMap_ptr
ScalarMapOnField(Result_ptr theResult,
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);
virtual
ScalarMapOnDeformedShape_ptr
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Double theIteration);
+ 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
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
myPresentType = VISU::PresentationType(VISU::GetResourceMgr()->integerValue("VISU" , "mesh_represent", 2));
if(myEntity == VISU::NODE_ENTITY)
myPresentType = VISU::POINT;
- myName = GenerateName().latin1();
+ SetName(GenerateName().latin1());
myCellColor.R = 0.0; myCellColor.G = myCellColor.B = 1.0;
myNodeColor.R = myNodeColor.G = 1.0; myNodeColor.B = 1.0;
myLinkColor.R = myLinkColor.G = myLinkColor.B = 83/255.;
VISU::Prs3d_i
::Restore(const Storable::TRestoringMap& theMap)
{
- myName = VISU::Storable::FindValue(theMap,"myName").latin1();
+ SetName(VISU::Storable::FindValue(theMap,"myName").latin1());
myOffset[0] = VISU::Storable::FindValue(theMap,"myOffset[0]").toFloat();
myOffset[1] = VISU::Storable::FindValue(theMap,"myOffset[1]").toFloat();
myOffset[2] = VISU::Storable::FindValue(theMap,"myOffset[2]").toFloat();
VISU::Prs3d_i
::ToStream(std::ostringstream& theStr)
{
- Storable::DataToStream( theStr, "myName", myName.c_str() );
+ Storable::DataToStream( theStr, "myName", GetName().c_str() );
Storable::DataToStream( theStr, "myOffset[0]", myOffset[0] );
Storable::DataToStream( theStr, "myOffset[1]", myOffset[1] );
Storable::DataToStream( theStr, "myOffset[2]", myOffset[2] );
GetIO()
{
if( myIO.IsNull() )
- myIO = new SALOME_InteractiveObject(GetEntry(),"VISU",GetName());
+ myIO = new SALOME_InteractiveObject(GetEntry().c_str(), "VISU", GetName().c_str());
return myIO;
}
#endif
//---------------------------------------------------------------
-VISU::PrsObject_i
-::PrsObject_i(SALOMEDS::Study_ptr theStudy):
- myStudy(SALOMEDS::Study::_duplicate(theStudy))
+VISU::RemovableObject_i
+::RemovableObject_i()
{
- if(MYDEBUG) MESSAGE("PrsObject_i::PrsObject_i - this = "<<this);
+ if(MYDEBUG) MESSAGE("RemovableObject_i::RemovableObject_i - this = "<<this);
}
//---------------------------------------------------------------
-VISU::PrsObject_i
-::~PrsObject_i()
+VISU::RemovableObject_i
+::~RemovableObject_i()
{
- if(MYDEBUG) MESSAGE("PrsObject_i::~PrsObject_i - this = "<<this);
+ if(MYDEBUG) MESSAGE("RemovableObject_i::~RemovableObject_i - this = "<<this);
}
//---------------------------------------------------------------
void
-VISU::PrsObject_i
+VISU::RemovableObject_i
::SetName(const std::string& theName)
{
myName = theName;
- SALOMEDS::SObject_var aSObject = myStudy->FindObjectID( GetEntry() );
+ SALOMEDS::SObject_var aSObject = myStudy->FindObjectID(GetEntry().c_str());
if(!aSObject->_is_nil()){
SALOMEDS::StudyBuilder_var aBuilder = myStudy->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr = aBuilder->FindOrCreateAttribute( aSObject, "AttributeName" );
//---------------------------------------------------------------
-const char*
-VISU::PrsObject_i
+const std::string&
+VISU::RemovableObject_i
::GetName() const
{
- return myName.c_str();
+ return myName;
}
//---------------------------------------------------------------
const SALOMEDS::Study_var&
-VISU::PrsObject_i
+VISU::RemovableObject_i
::GetStudyDocument() const
{
return myStudy;
//---------------------------------------------------------------
void
-VISU::PrsObject_i
+VISU::RemovableObject_i
::SetStudyDocument(SALOMEDS::Study_ptr theStudy)
{
myStudy = SALOMEDS::Study::_duplicate(theStudy);
//---------------------------------------------------------------
-QString
-VISU::PrsObject_i
+std::string
+VISU::RemovableObject_i
::GetEntry()
{
CORBA::String_var anIOR = GetID();
SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(anIOR.in());
- CORBA::String_var anEntry;
+ CORBA::String_var anEntry("");
if(!CORBA::is_nil(aSObject.in()))
anEntry = aSObject->GetID();
else
MESSAGE("PrsObject_i::GetEntry - Cannot find SObject in the Study with StudyId = "<<myStudy->StudyId()<<" !!!");
return anEntry.in();
}
+
+
+//---------------------------------------------------------------
+VISU::PrsObject_i
+::PrsObject_i(SALOMEDS::Study_ptr theStudy)
+{
+ SetStudyDocument(theStudy);
+}
+
+
namespace VISU
{
- class PrsObject_i : public virtual POA_VISU::PrsObject,
- public virtual RemovableObject_i
+ //----------------------------------------------------------------------------
+ class RemovableObject_i : public virtual POA_VISU::RemovableObject,
+ public virtual Storable
{
- PrsObject_i(const PrsObject_i&);
- SALOMEDS::Study_var myStudy;
-
public:
- PrsObject_i(SALOMEDS::Study_ptr theStudy = SALOMEDS::Study::_nil());
+ typedef Storable TSuperClass;
virtual
- ~PrsObject_i();
+ ~RemovableObject_i();
- protected:
- void
- SetStudyDocument(SALOMEDS::Study_ptr theStudy);
+ const SALOMEDS::Study_var&
+ GetStudyDocument() const;
- std::string myName;
+ virtual
+ std::string
+ GetEntry();
- public:
virtual
- const char*
+ const std::string&
GetName() const;
virtual
void
SetName(const std::string& theName);
- const SALOMEDS::Study_var&
- GetStudyDocument() const;
+ protected:
+ RemovableObject_i();
- virtual
- QString
- GetEntry();
+ void
+ SetStudyDocument(SALOMEDS::Study_ptr theStudy);
+
+ private:
+ std::string myName;
+ SALOMEDS::Study_var myStudy;
+
+ RemovableObject_i(const RemovableObject_i&);
+ };
+
+
+ //----------------------------------------------------------------------------
+ class PrsObject_i : public virtual POA_VISU::PrsObject,
+ public virtual RemovableObject_i
+ {
+ PrsObject_i(const PrsObject_i&);
+ SALOMEDS::Study_var myStudy;
+
+ public:
+ typedef RemovableObject_i TSuperClass;
+
+ PrsObject_i(SALOMEDS::Study_ptr theStudy);
};
}
#ifndef __VISU_RESULT_I_H__
#define __VISU_RESULT_I_H__
-#include "VISUConfig.hh"
+#include "VISU_PrsObject_i.hh"
#include "VISU_BoostSignals.h"
#include "SALOME_GenericObj_i.hh"
VISU::Storable* VISU::Table_i::Create()
{
// generate name ...
- myName = GetTableTitle();
+ SetName(GetTableTitle());
// mpv (PAL 5357): if name attribute already exist at this label, use it as name of table
- if ( myName == "" )
+ if ( GetName() == "" )
if ( !mySObj->_is_nil() ) {
CutLines_i* pCutLines = NULL;
CORBA::Object_var anObj = SObjectToObject(mySObj);
pCutLines = dynamic_cast<CutLines_i*>(GetServant(aCutLines).in());
}
if (!pCutLines)
- if (mySObj->GetName()) myName = mySObj->GetName();
+ if (mySObj->GetName()) SetName(mySObj->GetName());
}
- if ( myName == "" )
- myName = GenerateName();
+ if ( GetName() == "" )
+ SetName(GenerateName());
// ... and build the object
return Build( false );
}
VISU::Storable* VISU::Table_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO)
{
if(MYDEBUG) MESSAGE(GetComment());
- myName = VISU::Storable::FindValue(theMap,"myName").latin1();
+ SetName(VISU::Storable::FindValue(theMap,"myName").latin1());
myTitle = VISU::Storable::FindValue(theMap,"myTitle").latin1();
myOrientation = ( VISU::Table::Orientation )( VISU::Storable::FindValue(theMap,"myOrientation").toInt() );
mySObj = SALOMEDS::SObject::_duplicate(SO);
*/
void VISU::Table_i::ToStream( std::ostringstream& theStr )
{
- Storable::DataToStream( theStr, "myName", myName.c_str() );
+ Storable::DataToStream( theStr, "myName", GetName().c_str() );
Storable::DataToStream( theStr, "myTitle", myTitle.c_str() );
Storable::DataToStream( theStr, "myOrientation", myOrientation );
}
VISU::Storable* VISU::Curve_i::Create()
{
// generate name ...
- myName = GetVerTitle();
- if ( myName == "" )
- myName = GenerateName();
+ SetName(GetVerTitle());
+ if ( GetName() == "" )
+ SetName(GenerateName());
// ... and build the object
return Build( false );
}
SALOMEDS::Color color = GetColor();
crv->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
crv->setAutoAssign( IsAuto() );
- crv->setIO(new SALOME_InteractiveObject(mySObj->GetID(),"VISU",GetName()));
+ CORBA::String_var aString = mySObj->GetID();
+ crv->setIO(new SALOME_InteractiveObject(aString.in(), "VISU", GetName().c_str()));
if ( myTable )
- crv->setTableIO(new SALOME_InteractiveObject(myTable->GetObjectEntry(),"VISU",myTable->GetName()));
+ crv->setTableIO(new SALOME_InteractiveObject(myTable->GetObjectEntry(), "VISU", myTable->GetName().c_str()));
return crv;
}
/*!
{
if(MYDEBUG) MESSAGE(GetComment());
mySObj = SALOMEDS::SObject::_duplicate(theSO);
- myName = VISU::Storable::FindValue(theMap,"myName").latin1();
+ SetName(VISU::Storable::FindValue(theMap,"myName").latin1());
myHRow = VISU::Storable::FindValue(theMap,"myHRow").toInt();
myVRow = VISU::Storable::FindValue(theMap,"myVRow").toInt();
bool ok = false;
*/
void VISU::Curve_i::ToStream( std::ostringstream& theStr )
{
- Storable::DataToStream( theStr, "myName", myName.c_str() );
+ Storable::DataToStream( theStr, "myName", GetName().c_str() );
Storable::DataToStream( theStr, "myHRow", myHRow );
Storable::DataToStream( theStr, "myVRow", myVRow );
Storable::DataToStream( theStr, "myZRow", myZRow );
{
if ( GetStudyDocument()->_is_nil() )
return;
- SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
+ SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry().c_str() );
if ( mySO->_is_nil() )
return;
PortableServer::POA_ptr aPOA = GetPOA();
{
if ( GetStudyDocument()->_is_nil() )
return;
- SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
+ SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry().c_str() );
if ( mySO->_is_nil() )
return;
PortableServer::POA_ptr aPOA = GetPOA();
{
if ( GetStudyDocument()->_is_nil() )
return;
- SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
+ SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry().c_str() );
if ( mySO->_is_nil() )
return;
QStringList toDelete;
VISU::Storable* VISU::Container_i::Create()
{
// generate name ...
- myName = GenerateName();
+ SetName(GenerateName());
// ... and build the object
return Build( false );
}
if ( GetStudyDocument()->_is_nil() )
return;
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
- SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
+ SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry().c_str() );
SALOMEDS::GenericAttribute_var anAttr;
if ( !mySO->_is_nil() ) {
QStringList toDelete;
{
if(MYDEBUG) MESSAGE(GetComment());
mySObj = SALOMEDS::SObject::_duplicate(SO);
- myName = VISU::Storable::FindValue( theMap, "myName" ).latin1();
+ SetName(VISU::Storable::FindValue( theMap, "myName" ).latin1());
QString val = VISU::Storable::FindValue( theMap, "myCurves" );
myCurves = QStringList::split( QString( "*" ), val, false );
return Build( true );
*/
void VISU::Container_i::ToStream( std::ostringstream& theStr )
{
- Storable::DataToStream( theStr, "myName", myName.c_str() );
+ Storable::DataToStream( theStr, "myName", GetName().c_str() );
Storable::DataToStream( theStr, "myCurves", myCurves.join( QString( "*" ) ) );
// theStr<<" myName "<<myName;
// theStr<<" myCurves "<<myCurves.join( QString( "*" ) ).latin1()<<"* ";
virtual VISU::VISUType GetType() { return VISU::TTABLE;};
virtual void SetTitle( const char* theTitle ) { SetName( theTitle ); }
- virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
+ virtual char* GetTitle() { return CORBA::string_dup( GetName().c_str() ); }
virtual void SetOrientation( VISU::Table::Orientation theOrientation ) { myOrientation = theOrientation; }
virtual VISU::Table::Orientation GetOrientation() { return myOrientation; }
virtual VISU::VISUType GetType() { return VISU::TCURVE;};
virtual void SetTitle( const char* theTitle ) { SetName( theTitle ); }
- virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
+ virtual char* GetTitle() { return CORBA::string_dup( GetName().c_str() ); }
virtual void SetColor( const SALOMEDS::Color& theColor ) { myColor = theColor; myAuto = false; }
virtual SALOMEDS::Color GetColor() { return myColor; }
for (int i = 0; i < clist.count(); i++) {
SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
if (aSPlot2dC->hasIO() &&
- !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
+ theCurve->GetEntry() != aSPlot2dC->getIO()->getEntry()) {
if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing : curve - " << aSPlot2dC);
theView->eraseCurve(aSPlot2dC);
}
for (int i = 0; i < clist.count(); i++) {
SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
if (aSPlot2dC->hasIO() &&
- !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
+ theCurve->GetEntry() != aSPlot2dC->getIO()->getEntry()) {
if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve - " << aSPlot2dC);
aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
for (int i = 0; i < clist.count(); i++) {
SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
if (aSPlot2dC->hasIO() &&
- !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
+ theCurve->GetEntry() != aSPlot2dC->getIO()->getEntry()) {
if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve - " << aSPlot2dC);
aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
for (int i = 0; i < clist.count(); i++) {
if (SPlot2d_Curve* cu = dynamic_cast<SPlot2d_Curve*>(clist.at(i))) {
if (cu->hasIO() &&
- strcmp(cu->getIO()->getEntry(), myPrs->GetEntry()) == 0) {
+ myPrs->GetEntry() == cu->getIO()->getEntry()) {
vf->eraseCurve(cu);
}
}
}
}
if (!aCStudy) return;
- _PTR(SObject) TableSO = aCStudy->FindObjectID(aTable->GetEntry().latin1());
+ _PTR(SObject) TableSO = aCStudy->FindObjectID(aTable->GetEntry());
if (TableSO) {
_PTR(ChildIterator) Iter = aCStudy->NewChildIterator(TableSO);
for (; Iter->More(); Iter->Next()) {
#---------------------------------------------------------------
aMedFile = "TimeStamps.med"
-aMedFile = "ResOK_0000.med"
+#aMedFile = "ResOK_0000.med"
aMedFile = os.getenv('DATA_DIR') + '/MedFiles/' + aMedFile
aResult = myVisu.ImportFile(aMedFile)
WalkTroughTimeStamps(VISU.TSCALARMAP, anInput, aViewManager)
-for aVISUType in PRS3D_TYPE_LIST:
- WalkTroughTimeStamps(aVISUType, anInput, aViewManager)
- pass
+#for aVISUType in PRS3D_TYPE_LIST:
+# WalkTroughTimeStamps(aVISUType, anInput, aViewManager)
+# pass
+#
+#anInput.myEntity = VISU.CELL;
+#anInput.myFieldName = "pression";
+#WalkTroughTimeStamps(VISU.TGAUSSPOINTS, anInput, aViewManager)
-anInput.myEntity = VISU.CELL;
-anInput.myFieldName = "pression";
-WalkTroughTimeStamps(VISU.TGAUSSPOINTS, anInput, aViewManager)
+#execfile('/data/apo/a.py')
\ No newline at end of file